Class AnnotationStatementSupport
java.lang.Object
org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport<AnnotationName,AnnotationStatement,AnnotationEffectiveStatement>
org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport<AnnotationName,AnnotationStatement,AnnotationEffectiveStatement>
org.opendaylight.yangtools.rfc7952.parser.AnnotationStatementSupport
- All Implemented Interfaces:
StatementFactory<AnnotationName,
AnnotationStatement, AnnotationEffectiveStatement>
public final class AnnotationStatementSupport
extends AbstractStatementSupport<AnnotationName,AnnotationStatement,AnnotationEffectiveStatement>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport
StatementSupport.CopyPolicy, StatementSupport.StatementEquality<A,
D extends DeclaredStatement<A>>, StatementSupport.StatementPolicy<A, D extends DeclaredStatement<A>> -
Field Summary
Fields inherited from class org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport
NAMESPACE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadaptArgumentValue
(StmtContext<AnnotationName, AnnotationStatement, AnnotationEffectiveStatement> ctx, QNameModule targetModule) Adapts the argument value to match a new module.protected AnnotationStatement
attachDeclarationReference
(AnnotationStatement stmt, DeclarationReference reference) Attach specifiedDeclarationReference
to a baseline declared statement.protected AnnotationStatement
createDeclared
(BoundStmtCtx<AnnotationName> ctx, ImmutableList<DeclaredStatement<?>> substatements) protected AnnotationEffectiveStatement
createEffective
(EffectiveStmtCtx.Current<AnnotationName, AnnotationStatement> stmt, ImmutableList<? extends EffectiveStatement<?, ?>> substatements) void
onStatementAdded
(StmtContext.Mutable<AnnotationName, AnnotationStatement, AnnotationEffectiveStatement> stmt) Invoked when a statement supported by this instance is added to build context.parseArgumentValue
(StmtContext<?, ?, ?> ctx, String value) Parses textual representation of argument in object representation.Methods inherited from class org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport
buildEffectiveSubstatements, copyEffective, createDeclared, createEffective, findFirstArgument, findFirstStatement, statementsToBuild, substatementValidator
Methods inherited from class org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport
argumentName, canReuseCurrent, copyPolicy, definition, extractEffectiveState, getArgumentDefinition, getPublicView, getSupportSpecificForArgument, hasArgumentSpecificSupports, internArgument, isIgnoringConfig, isIgnoringIfFeatures, onFullDefinitionDeclared, onLinkageDeclared, onPreLinkageDeclared, onStatementDefinitionDeclared, statementName
-
Constructor Details
-
AnnotationStatementSupport
-
-
Method Details
-
parseArgumentValue
Description copied from class:StatementSupport
Parses textual representation of argument in object representation.- Specified by:
parseArgumentValue
in classStatementSupport<AnnotationName,
AnnotationStatement, AnnotationEffectiveStatement> - 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
-
adaptArgumentValue
public AnnotationName adaptArgumentValue(StmtContext<AnnotationName, AnnotationStatement, AnnotationEffectiveStatement> ctx, QNameModule targetModule) Description copied from class:StatementSupport
Adapts the argument value to match a new module. Default implementation returns original value stored in context, which is appropriate for most implementations.- Overrides:
adaptArgumentValue
in classStatementSupport<AnnotationName,
AnnotationStatement, AnnotationEffectiveStatement> - Parameters:
ctx
- Context, which may be used to access source-specific namespaces required for parsing.targetModule
- Target module, may not be null.- Returns:
- Adapted argument value.
-
onStatementAdded
public void onStatementAdded(StmtContext.Mutable<AnnotationName, AnnotationStatement, AnnotationEffectiveStatement> 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 viaStmtContext.getParentContext()
. One such use is populating the parent's namespaces to allow it to locate this child statement.- Overrides:
onStatementAdded
in classStatementSupport<AnnotationName,
AnnotationStatement, AnnotationEffectiveStatement> - Parameters:
stmt
- Context of added statement. No substatements are available.
-
createDeclared
protected AnnotationStatement createDeclared(BoundStmtCtx<AnnotationName> ctx, ImmutableList<DeclaredStatement<?>> substatements) - Specified by:
createDeclared
in classAbstractStatementSupport<AnnotationName,
AnnotationStatement, AnnotationEffectiveStatement>
-
attachDeclarationReference
protected AnnotationStatement attachDeclarationReference(AnnotationStatement stmt, DeclarationReference reference) Description copied from class:AbstractStatementSupport
Attach specifiedDeclarationReference
to a baseline declared statement. If an implementation does not support attaching DeclarationReferences, it should return the statement unchanged.- Specified by:
attachDeclarationReference
in classAbstractStatementSupport<AnnotationName,
AnnotationStatement, AnnotationEffectiveStatement> - Parameters:
stmt
- Declared statementreference
-DeclarationReference
to attach- Returns:
- Equivalent of stmt, potentially with specified reference attached.
-
createEffective
protected AnnotationEffectiveStatement createEffective(EffectiveStmtCtx.Current<AnnotationName, AnnotationStatement> stmt, ImmutableList<? extends EffectiveStatement<?, ?>> substatements) - Specified by:
createEffective
in classAbstractStatementSupport<AnnotationName,
AnnotationStatement, AnnotationEffectiveStatement>
-