Interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
-
- Type Parameters:
A
- Argument typeD
- Declared Statement representationE
- Effective Statement representation
- All Superinterfaces:
StmtContext<A,D,E>
- All Known Implementing Classes:
RootStatementContext
,StatementContextBase
- Enclosing interface:
- StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public static interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>> extends StmtContext<A,D,E>
An mutable view of an inference context associated with an instance of a statement.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext
StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addAsEffectOfStatement(Collection<? extends StmtContext<?,?,?>> ctxs)
void
addAsEffectOfStatement(StmtContext<?,?,?> ctx)
<K,KT extends K,N extends StatementNamespace<K,?,?>>
voidaddContext(Class<N> namespace, KT key, StmtContext<?,?,?> stmt)
Adds s statement to namespace map with a key.void
addMutableStmtToSeal(MutableStatement mutableStatement)
Add mutable statement to seal.void
addRequiredSource(SourceIdentifier dependency)
Add required module.<K,V,T extends K,U extends V,N extends IdentifierNamespace<K,V>>
voidaddToNs(Class<N> type, T key, U value)
Associate a value with a key within a namespace.default StmtContext.Mutable<?,?,?>
childCopyOf(StmtContext<?,?,?> stmt, CopyType type)
Create a child sub-statement, which is a child of this statement, inheriting all attributes from specified child and recording copy type.StmtContext.Mutable<?,?,?>
childCopyOf(StmtContext<?,?,?> stmt, CopyType type, @Nullable QNameModule targetModule)
Create a child sub-statement, which is a child of this statement, inheriting all attributes from specified child and recording copy type.default StmtContext.Mutable<?,?,?>
coerceParentContext()
Return the parent statement context, forcing a VerifyException if this is the root statement.@NonNull Optional<? extends StmtContext.Mutable<?,?,?>>
copyAsChildOf(StmtContext.Mutable<?,?,?> parent, CopyType type, @Nullable QNameModule targetModule)
default Collection<? extends StmtContext<?,?,?>>
declaredSubstatements()
Return declared substatements.default Collection<? extends StmtContext<?,?,?>>
effectiveSubstatements()
Return effective substatements.StmtContext.Mutable<?,?,?>
getParentContext()
Return the parent statement context, or null if this is the root statement.StmtContext.Mutable<?,?,?>
getRoot()
@NonNull Collection<? extends StmtContext.Mutable<?,?,?>>
mutableDeclaredSubstatements()
@NonNull Collection<? extends StmtContext.Mutable<?,?,?>>
mutableEffectiveSubstatements()
@NonNull ModelActionBuilder
newInferenceAction(@NonNull ModelProcessingPhase phase)
Create a new inference action to be executed during specified phase.void
setIsSupportedToBuildEffective(boolean isSupportedToBuild)
void
setRootIdentifier(SourceIdentifier identifier)
Set identifier of current root context.void
setRootVersion(YangVersion version)
Set version of root statement context.-
Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext
allSubstatements, allSubstatementsStream, buildDeclared, buildEffective, coerceRawStatementArgument, coerceStatementArgument, getAllFromCurrentStmtCtxNamespace, getAllFromNamespace, getCompletedPhase, getCopyHistory, getEffectOfStatement, getFromNamespace, getOriginalCtx, getPreviousCopyCtx, getPublicDefinition, getRootVersion, getSchemaPath, getStatementArgument, getStatementSource, getStatementSourceReference, isConfiguration, isEnabledSemanticVersioning, isSupportedByFeatures, isSupportedToBuildEffective, producesDeclared, producesEffective, rawStatementArgument
-
-
-
-
Method Detail
-
getParentContext
StmtContext.Mutable<?,?,?> getParentContext()
Description copied from interface:StmtContext
Return the parent statement context, or null if this is the root statement.- Specified by:
getParentContext
in interfaceStmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
- Returns:
- context of parent of statement, or null if this is the root statement.
-
coerceParentContext
default StmtContext.Mutable<?,?,?> coerceParentContext()
Description copied from interface:StmtContext
Return the parent statement context, forcing a VerifyException if this is the root statement.- Specified by:
coerceParentContext
in interfaceStmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
- Returns:
- context of parent of statement
-
addToNs
<K,V,T extends K,U extends V,N extends IdentifierNamespace<K,V>> void addToNs(Class<N> type, T key, U value)
Associate a value with a key within a namespace.- Type Parameters:
K
- namespace key typeV
- namespace value typeN
- namespace typeT
- key typeU
- value type- Parameters:
type
- Namespace typekey
- Keyvalue
- value- Throws:
NamespaceNotAvailableException
- when the namespace is not available.
-
getRoot
StmtContext.Mutable<?,?,?> getRoot()
- Specified by:
getRoot
in interfaceStmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
-
childCopyOf
StmtContext.Mutable<?,?,?> childCopyOf(StmtContext<?,?,?> stmt, CopyType type, @Nullable QNameModule targetModule)
Create a child sub-statement, which is a child of this statement, inheriting all attributes from specified child and recording copy type. Resulting object may only be added as a child of this statement.- Parameters:
stmt
- Statement to be used as a templatetype
- Type of copy to record in historytargetModule
- Optional new target module- Returns:
- copy of statement considering
CopyType
(augment, uses) - Throws:
IllegalArgumentException
- if stmt cannot be copied into this statement, for example because it comes from an alien implementation.SourceException
- instance of SourceException
-
childCopyOf
default StmtContext.Mutable<?,?,?> childCopyOf(StmtContext<?,?,?> stmt, CopyType type)
Create a child sub-statement, which is a child of this statement, inheriting all attributes from specified child and recording copy type. Resulting object may only be added as a child of this statement.- Parameters:
stmt
- Statement to be used as a templatetype
- Type of copy to record in history- Returns:
- copy of statement considering
CopyType
(augment, uses) - Throws:
IllegalArgumentException
- if stmt cannot be copied into this statement, for example because it comes from an alien implementation.SourceException
- instance of SourceException
-
copyAsChildOf
@Beta @NonNull Optional<? extends StmtContext.Mutable<?,?,?>> copyAsChildOf(StmtContext.Mutable<?,?,?> parent, CopyType type, @Nullable QNameModule targetModule)
-
declaredSubstatements
default Collection<? extends StmtContext<?,?,?>> declaredSubstatements()
Description copied from interface:StmtContext
Return declared substatements. These are the statements which are explicitly written in the source model.- Specified by:
declaredSubstatements
in interfaceStmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
- Returns:
- Collection of declared substatements
-
mutableDeclaredSubstatements
@NonNull Collection<? extends StmtContext.Mutable<?,?,?>> mutableDeclaredSubstatements()
-
effectiveSubstatements
default Collection<? extends StmtContext<?,?,?>> effectiveSubstatements()
Description copied from interface:StmtContext
Return effective substatements. These are the statements which are added as this statement's substatements complete their effective model phase.- Specified by:
effectiveSubstatements
in interfaceStmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
- Returns:
- Collection of declared substatements
-
mutableEffectiveSubstatements
@NonNull Collection<? extends StmtContext.Mutable<?,?,?>> mutableEffectiveSubstatements()
-
newInferenceAction
@NonNull ModelActionBuilder newInferenceAction(@NonNull ModelProcessingPhase phase)
Create a new inference action to be executed during specified phase. The action cannot be cancelled and will be executed even if its definition remains incomplete. The specified phase cannot complete until this action is resolved. If the action cannot be resolved, model processing will fail.- Parameters:
phase
- Target phase in which the action will resolved.- Returns:
- A new action builder.
- Throws:
NullPointerException
- if the specified phase is null
-
addContext
<K,KT extends K,N extends StatementNamespace<K,?,?>> void addContext(Class<N> namespace, KT key, StmtContext<?,?,?> stmt)
Adds s statement to namespace map with a key.- Parameters:
namespace
-StatementNamespace
child that determines namespace to be added tokey
- of type according to namespace class specificationstmt
- to be added to namespace map
-
setRootVersion
void setRootVersion(YangVersion version)
Set version of root statement context.- Parameters:
version
- of root statement context
-
addMutableStmtToSeal
void addMutableStmtToSeal(MutableStatement mutableStatement)
Add mutable statement to seal. Each mutable statement must be sealed as the last step of statement parser processing.- Parameters:
mutableStatement
- mutable statement which should be sealed
-
addRequiredSource
void addRequiredSource(SourceIdentifier dependency)
Add required module. Based on these dependencies are collected required sources from library sources.- Parameters:
dependency
- SourceIdentifier of module required by current root context
-
addAsEffectOfStatement
void addAsEffectOfStatement(StmtContext<?,?,?> ctx)
-
addAsEffectOfStatement
void addAsEffectOfStatement(Collection<? extends StmtContext<?,?,?>> ctxs)
-
setRootIdentifier
void setRootIdentifier(SourceIdentifier identifier)
Set identifier of current root context.- Parameters:
identifier
- of current root context, must not be null
-
setIsSupportedToBuildEffective
void setIsSupportedToBuildEffective(boolean isSupportedToBuild)
-
-