Class ForwardingStatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>

java.lang.Object
org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport<A,D,E>
org.opendaylight.yangtools.yang.parser.spi.meta.ForwardingStatementSupport<A,D,E>
Type Parameters:
A - Argument type
D - Declared Statement representation
E - Effective Statement representation
All Implemented Interfaces:
StatementFactory<A,D,E>

@Beta public abstract class ForwardingStatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>> extends StatementSupport<A,D,E>
Utility forwarding implementation of StatementSupport contract. This class is useful for implementing wrapped statements.
Author:
Robert Varga
  • Constructor Details

    • ForwardingStatementSupport

      protected ForwardingStatementSupport(StatementSupport<A,D,E> delegate)
  • Method Details

    • createDeclared

      public D createDeclared(BoundStmtCtx<A> ctx, Stream<org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<?>> substatements)
      Description copied from interface: StatementFactory
      Create a DeclaredStatement for specified context.
      Parameters:
      ctx - Statement context
      substatements - Declared substatements
      Returns:
      A declared statement instance.
    • createEffective

      public E createEffective(EffectiveStmtCtx.Current<A,D> stmt, Stream<? extends StmtContext<?,?,?>> declaredSubstatements, Stream<? extends StmtContext<?,?,?>> inferredSubstatements)
      Description copied from interface: StatementFactory
      Create a EffectiveStatement for specified context.
      Parameters:
      stmt - Effective capture of this statement's significant state
      declaredSubstatements - effectively-visible declared substatements
      inferredSubstatements - effectively-visible inferred substatements
      Returns:
      An effective statement instance
    • copyEffective

      public E copyEffective(EffectiveStmtCtx.Current<A,D> stmt, E original)
      Description copied from interface: StatementFactory
      Create a EffectiveStatement copy of provided original for specified context.
      Parameters:
      stmt - Effective capture of this statement's significant state
      original - Original effective statement
      Returns:
      An effective statement instance
    • parseArgumentValue

      public A parseArgumentValue(StmtContext<?,?,?> ctx, String value)
      Description copied from class: StatementSupport
      Parses textual representation of argument in object representation.
      Specified by:
      parseArgumentValue in class StatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
      Parameters:
      ctx - Context, which may be used to access source-specific namespaces required for parsing.
      value - String representation of value, as was present in text source.
      Returns:
      Parsed value
    • onStatementAdded

      public void onStatementAdded(StmtContext.Mutable<A,D,E> stmt)
      Description copied from class: StatementSupport
      Invoked when a statement supported by this instance is added to build context. This allows implementations of this interface to start tracking the statement and perform any modifications to the build context hierarchy, accessible via StmtContext.getParentContext(). One such use is populating the parent's namespaces to allow it to locate this child statement.
      Overrides:
      onStatementAdded in class StatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
      Parameters:
      stmt - Context of added statement. No substatements are available.
    • onPreLinkageDeclared

      public void onPreLinkageDeclared(StmtContext.Mutable<A,D,E> stmt)
      Description copied from class: StatementSupport
      Invoked when statement is closed during ModelProcessingPhase.SOURCE_PRE_LINKAGE phase, only substatements from this and previous phase are available.

      Implementation may use method to perform actions on this event or register modification action using StmtContext.Mutable.newInferenceAction(ModelProcessingPhase).

      Overrides:
      onPreLinkageDeclared in class StatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
      Parameters:
      stmt - Context of added statement.
    • onLinkageDeclared

      public void onLinkageDeclared(StmtContext.Mutable<A,D,E> stmt)
      Description copied from class: StatementSupport
      Invoked when statement is closed during ModelProcessingPhase.SOURCE_LINKAGE phase, only substatements from this and previous phase are available.

      Implementation may use method to perform actions on this event or register modification action using StmtContext.Mutable.newInferenceAction(ModelProcessingPhase).

      Overrides:
      onLinkageDeclared in class StatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
      Parameters:
      stmt - Context of added statement.
    • onStatementDefinitionDeclared

      public void onStatementDefinitionDeclared(StmtContext.Mutable<A,D,E> stmt)
      Description copied from class: StatementSupport
      Invoked when statement is closed during ModelProcessingPhase.STATEMENT_DEFINITION phase, only substatements from this phase are available.

      Implementation may use method to perform actions on this event or register modification action using StmtContext.Mutable.newInferenceAction(ModelProcessingPhase).

      Overrides:
      onStatementDefinitionDeclared in class StatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
      Parameters:
      stmt - Context of added statement. Argument and statement parent is accessible.
    • onFullDefinitionDeclared

      public void onFullDefinitionDeclared(StmtContext.Mutable<A,D,E> stmt)
      Description copied from class: StatementSupport
      Invoked when statement is closed during ModelProcessingPhase.FULL_DECLARATION phase, only substatements from this phase are available.

      Implementation may use method to perform actions on this event or register modification action using StmtContext.Mutable.newInferenceAction(ModelProcessingPhase).

      Overrides:
      onFullDefinitionDeclared in class StatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
      Parameters:
      stmt - Context of added statement. Argument and statement parent is accessible.
    • hasArgumentSpecificSupports

      public boolean hasArgumentSpecificSupports()
      Description copied from class: StatementSupport
      Returns true if this support has argument specific supports.
      Overrides:
      hasArgumentSpecificSupports in class StatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
      Returns:
      true if this support has argument specific supports.
    • getSupportSpecificForArgument

      public StatementSupport<?,?,?> getSupportSpecificForArgument(String argument)
      Description copied from class: StatementSupport
      If this support has argument specific supports, the method returns support specific for given argument (e.g. type statement support need to be specialized based on its argument), otherwise returns null.
      Overrides:
      getSupportSpecificForArgument in class StatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
      Parameters:
      argument - argument of statement
      Returns:
      statement support specific for supplied argument or null
    • substatementValidator

      protected SubstatementValidator substatementValidator()
      Description copied from class: StatementSupport
      Returns corresponding substatement validator of a statement support.
      Specified by:
      substatementValidator in class StatementSupport<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
      Returns:
      substatement validator or null, if substatement validator is not defined
    • toString

      public String toString()
      Overrides:
      toString in class Object