A
- Argument typeD
- Declared Statement representationE
- Effective Statement representationpublic interface StatementSupport<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>> extends StatementDefinition, StatementFactory<A,D,E>
This interface is intended to be implemented by developers, which want to
introduce support of statement to parser. Consider subclassing
AbstractStatementSupport
for easier implementation of this interface.
Modifier and Type | Method and Description |
---|---|
default A |
adaptArgumentValue(StmtContext<A,D,E> ctx,
QNameModule targetModule)
Adapts the argument value to match a new module.
|
default QName |
getArgumentName()
Returns name of statement argument or null, if statement does not have argument.
|
default Class<? extends DeclaredStatement<?>> |
getDeclaredRepresentationClass()
Returns class which represents declared version of statement associated with this definition.
|
default Class<? extends EffectiveStatement<?,?>> |
getEffectiveRepresentationClass()
Returns class which represents derived behaviour from supplied statement.
|
@NonNull StatementDefinition |
getPublicView()
Returns public statement definition, which will be present in built statements.
|
default QName |
getStatementName()
Returns name of the statement.
|
@Nullable StatementSupport<?,?,?> |
getSupportSpecificForArgument(String argument)
If this support has argument specific supports, the method returns support specific for given argument
(e.g.
|
default Optional<StatementSupport<?,?,?>> |
getUnknownStatementDefinitionOf(StatementDefinition yangStmtDef)
Returns unknown statement form of a regular YANG statement supplied as a parameter to the method.
|
boolean |
hasArgumentSpecificSupports()
Returns true if this support has argument specific supports.
|
default String |
internArgument(String rawArgument)
Given a raw string representation of an argument, try to use a shared representation.
|
default boolean |
isArgumentYinElement()
Returns true, if argument of statement is represented as value of yin element.
|
default boolean |
isIgnoringConfig()
Returns true if this statement support and all its substatements ignore config statements (e.g.
|
default boolean |
isIgnoringIfFeatures()
Returns true if this statement support and all its substatements ignore if-feature statements (e.g.
|
void |
onFullDefinitionDeclared(StmtContext.Mutable<A,D,E> stmt)
Invoked when statement is closed during
ModelProcessingPhase.FULL_DECLARATION phase,
only substatements from this phase are available. |
void |
onLinkageDeclared(StmtContext.Mutable<A,D,E> stmt)
Invoked when statement is closed during
ModelProcessingPhase.SOURCE_LINKAGE phase, only substatements
from this and previous phase are available. |
void |
onPreLinkageDeclared(StmtContext.Mutable<A,D,E> stmt)
Invoked when statement is closed during
ModelProcessingPhase.SOURCE_PRE_LINKAGE phase, only substatements
from this and previous phase are available. |
void |
onStatementAdded(StmtContext.Mutable<A,D,E> stmt)
Invoked when a statement supported by this instance is added to build context.
|
void |
onStatementDefinitionDeclared(StmtContext.Mutable<A,D,E> stmt)
Invoked when statement is closed during
ModelProcessingPhase.STATEMENT_DEFINITION phase,
only substatements from this phase are available. |
A |
parseArgumentValue(StmtContext<?,?,?> ctx,
String value)
Parses textual representation of argument in object representation.
|
createDeclared, createEffective
@NonNull StatementDefinition getPublicView()
Public statement definition may be used to provide different implementation of statement definition, which will not retain any build specific data or context.
A parseArgumentValue(StmtContext<?,?,?> ctx, String value)
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.SourceException
- when an inconsistency is detected.default A adaptArgumentValue(StmtContext<A,D,E> ctx, QNameModule targetModule)
ctx
- Context, which may be used to access source-specific
namespaces required for parsing.targetModule
- Target module, may not be null.void onStatementAdded(StmtContext.Mutable<A,D,E> stmt)
StmtContext.getParentContext()
. One such use is populating the parent's namespaces to
allow it to locate this child statement.stmt
- Context of added statement. No substatements are available.void onPreLinkageDeclared(StmtContext.Mutable<A,D,E> stmt)
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)
.
stmt
- Context of added statement.void onLinkageDeclared(StmtContext.Mutable<A,D,E> stmt)
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)
.
stmt
- Context of added statement.SourceException
- when an inconsistency is detected.void onStatementDefinitionDeclared(StmtContext.Mutable<A,D,E> stmt)
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)
.
stmt
- Context of added statement. Argument and statement parent is
accessible.SourceException
- when an inconsistency is detected.void onFullDefinitionDeclared(StmtContext.Mutable<A,D,E> stmt)
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)
.
stmt
- Context of added statement. Argument and statement parent is
accessible.SourceException
- when an inconsistency is detected.boolean hasArgumentSpecificSupports()
@Nullable StatementSupport<?,?,?> getSupportSpecificForArgument(String argument)
argument
- argument of statementdefault String internArgument(String rawArgument)
rawArgument
- Argument stringdefault Optional<StatementSupport<?,?,?>> getUnknownStatementDefinitionOf(StatementDefinition yangStmtDef)
yangStmtDef
- statement definition of a regular yang statement@Beta default boolean isIgnoringIfFeatures()
@Beta default boolean isIgnoringConfig()
default QName getStatementName()
StatementDefinition
getStatementName
in interface StatementDefinition
default QName getArgumentName()
StatementDefinition
getArgumentName
in interface StatementDefinition
default Class<? extends DeclaredStatement<?>> getDeclaredRepresentationClass()
StatementDefinition
getDeclaredRepresentationClass
in interface StatementDefinition
default Class<? extends EffectiveStatement<?,?>> getEffectiveRepresentationClass()
StatementDefinition
getEffectiveRepresentationClass
in interface StatementDefinition
default boolean isArgumentYinElement()
StatementDefinition
isArgumentYinElement
in interface StatementDefinition
Copyright © 2019 OpenDaylight. All rights reserved.