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 |
---|---|
Optional<StatementContextBase<?,?,?>> |
beforeSubStatementCreated(StmtContext.Mutable<?,?,?> stmt,
int offset,
StatementDefinitionContext<?,?,?> def,
StatementSourceReference ref,
String argument)
Invoked before a substatement with specified offset, definition,
reference and argument is created and added to parent statement.
|
StatementDefinition |
getPublicView()
Returns public statement definition, which will be present in built
statements.
|
StatementSupport<?,?,?> |
getSupportSpecificForArgument(String argument)
If this support has argument specific supports, the method returns
support specific for given argument (e.g.
|
default Optional<StatementDefinitionContext<?,?,?>> |
getUnknownStatementDefinitionOf(StatementDefinitionContext<?,?,?> yangStmtDef)
Returns unknown statement form of a regular yang statement supplied as
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 |
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. |
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.
|
getArgumentName, getDeclaredRepresentationClass, getEffectiveRepresentationClass, getStatementName, isArgumentYinElement
createDeclared, createEffective
StatementDefinition getPublicView()
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.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.Optional<StatementContextBase<?,?,?>> beforeSubStatementCreated(StmtContext.Mutable<?,?,?> stmt, int offset, StatementDefinitionContext<?,?,?> def, StatementSourceReference ref, String argument)
stmt
- Context of parent statement where a new substatement should be
created. No substatements are available.offset
- substatement offsetdef
- definition contextref
- source referenceargument
- substatement argumentvoid 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.
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)
.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<StatementDefinitionContext<?,?,?>> getUnknownStatementDefinitionOf(StatementDefinitionContext<?,?,?> yangStmtDef)
yangStmtDef
- statement definition of a regular yang statement@Beta default boolean isIgnoringIfFeatures()
@Beta default boolean isIgnoringConfig()
Copyright © 2018 OpenDaylight. All rights reserved.