/* * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.parser.spi.meta; import com.google.common.annotations.Beta; import com.google.common.collect.ForwardingObject; import java.util.Collection; import java.util.stream.Stream; import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement; import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement; import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition; import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current; import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable; /** * Utility forwarding implementation of {@link StatementSupport} contract. This class is useful for implementing * wrapped statements. * * @author Robert Varga * * @param Argument type * @param Declared Statement representation * @param Effective Statement representation */ @Beta public abstract class ForwardingStatementSupport, E extends EffectiveStatement> extends ForwardingObject implements StatementSupport { @Override protected abstract StatementSupport delegate(); @Override public D createDeclared(final StmtContext ctx) { return delegate().createDeclared(ctx); } @Override public E createEffective(final Current stmt, final Stream> declaredSubstatements, final Stream> effectiveSubstatements) { return delegate().createEffective(stmt, declaredSubstatements, effectiveSubstatements); } @Override public StatementDefinition getPublicView() { return delegate().getPublicView(); } @Override public A parseArgumentValue(final StmtContext ctx, final String value) { return delegate().parseArgumentValue(ctx, value); } @Override public void onStatementAdded(final Mutable stmt) { delegate().onStatementAdded(stmt); } @Override public void onPreLinkageDeclared(final Mutable stmt) { delegate().onPreLinkageDeclared(stmt); } @Override public void onLinkageDeclared(final Mutable stmt) { delegate().onLinkageDeclared(stmt); } @Override public void onStatementDefinitionDeclared(final Mutable stmt) { delegate().onStatementDefinitionDeclared(stmt); } @Override public void onFullDefinitionDeclared(final Mutable stmt) { delegate().onFullDefinitionDeclared(stmt); } @Override public boolean hasArgumentSpecificSupports() { return delegate().hasArgumentSpecificSupports(); } @Override public StatementSupport getSupportSpecificForArgument(final String argument) { return delegate().getSupportSpecificForArgument(argument); } @Override public CopyPolicy copyPolicy() { return delegate().copyPolicy(); } @Override public boolean canReuseCurrent(final Current copy, final Current current, final Collection> substatements) { return delegate().canReuseCurrent(copy, current, substatements); } }