2 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.parser.spi.meta;
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ForwardingObject;
12 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
13 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
18 * Utility forwarding implementation of {@link StatementSupport} contract. This class is useful for implementing
21 * @author Robert Varga
23 * @param <A> Argument type
24 * @param <D> Declared Statement representation
25 * @param <E> Effective Statement representation
28 public abstract class ForwardingStatementSupport<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>>
29 extends ForwardingObject implements StatementSupport<A, D, E> {
32 protected abstract StatementSupport<A, D, E> delegate();
35 public D createDeclared(final StmtContext<A, D, ?> ctx) {
36 return delegate().createDeclared(ctx);
40 public E createEffective(final StmtContext<A, D, E> ctx) {
41 return delegate().createEffective(ctx);
45 public StatementDefinition getPublicView() {
46 return delegate().getPublicView();
50 public A parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
51 return delegate().parseArgumentValue(ctx, value);
55 public void onStatementAdded(final Mutable<A, D, E> stmt) {
56 delegate().onStatementAdded(stmt);
60 public void onPreLinkageDeclared(final Mutable<A, D, E> stmt) {
61 delegate().onPreLinkageDeclared(stmt);
65 public void onLinkageDeclared(final Mutable<A, D, E> stmt) {
66 delegate().onLinkageDeclared(stmt);
70 public void onStatementDefinitionDeclared(final Mutable<A, D, E> stmt) {
71 delegate().onStatementDefinitionDeclared(stmt);
75 public void onFullDefinitionDeclared(final Mutable<A, D, E> stmt) {
76 delegate().onFullDefinitionDeclared(stmt);
80 public boolean hasArgumentSpecificSupports() {
81 return delegate().hasArgumentSpecificSupports();
85 public StatementSupport<?, ?, ?> getSupportSpecificForArgument(final String argument) {
86 return delegate().getSupportSpecificForArgument(argument);