Interface StmtContext.Mutable<A,D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>,E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A,D>>
- Type Parameters:
A- Argument typeD- Declared Statement representationE- Effective Statement representation
- All Superinterfaces:
BoundStmtCtx<A>,BoundStmtCtxCompat<A,,D> CommonStmtCtx,NamespaceStmtCtx,StmtContext<A,,D, E> StmtContextCompat
- All Known Subinterfaces:
RootStmtContext.Mutable<A,D, E>
- Enclosing interface:
- StmtContext<A,
D extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>, E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A, D>>
public static interface StmtContext.Mutable<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 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 org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<A>, E extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<A, D>> -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAsEffectOfStatement(Collection<? extends StmtContext<?, ?, ?>> ctxs) <K,KT extends K, N extends StatementNamespace<K, ?, ?>>
voidaddContext(Class<@NonNull N> namespace, KT key, StmtContext<?, ?, ?> stmt) Adds s statement to namespace map with a key.voidaddEffectiveSubstatement(StmtContext.Mutable<?, ?, ?> substatement) Adds an effective statement to collection of substatements.voidaddEffectiveSubstatements(Collection<? extends StmtContext.Mutable<?, ?, ?>> statements) Adds an effective statement to collection of substatements.voidaddRequiredSource(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier dependency) Add required module.<K,V, T extends K, U extends V, N extends ParserNamespace<K, V>>
voidAssociate 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<?,?, ?> Return the parent statement context, forcing a VerifyException if this is the root statement.<X,Y extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<X>, Z extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<X, Y>>
@NonNull StmtContext.Mutable<X,Y, Z> createUndeclaredSubstatement(StatementSupport<X, Y, Z> support, @Nullable X arg) Create a purely-effective substatement.default Collection<? extends @NonNull StmtContext<?,?, ?>> Return declared substatements.default Collection<? extends @NonNull StmtContext<?,?, ?>> Return effective substatements.StmtContext.Mutable<?,?, ?> Return the parent statement context, or null if this is the root statement.RootStmtContext.Mutable<?,?, ?> getRoot()Returns the model root for this statement.boolean@NonNull Collection<? extends @NonNull StmtContext.Mutable<?,?, ?>> @NonNull Collection<? extends @NonNull StmtContext.Mutable<?,?, ?>> @NonNull ModelActionBuildernewInferenceAction(@NonNull ModelProcessingPhase phase) Create a new inference action to be executed during specified phase.voidremoveStatementFromEffectiveSubstatements(org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition statementDef) voidremoveStatementFromEffectiveSubstatements(org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition statementDef, String statementArg) Removes a statement context from the effective substatements based on its statement definition (i.e statement keyword) and raw (in String form) statement argument.voidsetRootIdentifier(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier identifier) Set identifier of current root context.voidsetRootVersion(YangVersion version) Set version of root statement context.voidStmtContext<?,?, ?> wrapWithImplicit(StmtContext<?, ?, ?> original) Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.BoundStmtCtx
argument, findSubstatementArgument, getArgument, hasSubstatement, yangVersionMethods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.BoundStmtCtxCompat
declaredMethods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.CommonStmtCtx
getRawArgument, producesDeclared, producesEffective, publicDefinition, rawArgument, sourceReferenceMethods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceStmtCtx
getAllFromNamespace, getFromNamespace, localNamespacePortion, namespace, namespaceItemMethods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext
allSubstatements, allSubstatementsStream, buildEffective, copyAsChildOf, getCompletedPhase, getEffectOfStatement, getOriginalCtx, getPreviousCopyCtx, isSupportedByFeatures, isSupportedToBuildEffective, replicaAsChildOfMethods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextCompat
history
-
Method Details
-
getParentContext
StmtContext.Mutable<?,?, getParentContext()?> Description copied from interface:StmtContextReturn the parent statement context, or null if this is the root statement.- Specified by:
getParentContextin interfaceStmtContext<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:
- context of parent of statement, or null if this is the root statement.
-
coerceParentContext
Description copied from interface:StmtContextReturn the parent statement context, forcing a VerifyException if this is the root statement.- Specified by:
coerceParentContextin interfaceStmtContext<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:
- context of parent of statement
-
addToNs
<K,V, void addToNsT extends K, U extends V, N extends ParserNamespace<K, V>> (Class<@NonNull 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
RootStmtContext.Mutable<?,?, getRoot()?> Description copied from interface:StmtContextReturns the model root for this statement. -
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
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
-
declaredSubstatements
Description copied from interface:StmtContextReturn declared substatements. These are the statements which are explicitly written in the source model, but reflect implicit containment statements as well. To but that statement into practical terms, this snippet:
reports the same structure as the canonical verbose equivalent:choice foo { container bar; }
Returned collection is therefore well suited for reasoning about the schema tree. It is not appropriate for populating populatingchoice foo { case bar { container bar; } }DeclaredStatement.declaredSubstatements().- Specified by:
declaredSubstatementsin interfaceStmtContext<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:
- Collection of declared substatements
-
mutableDeclaredSubstatements
@NonNull Collection<? extends @NonNull StmtContext.Mutable<?,?, mutableDeclaredSubstatements()?>> -
effectiveSubstatements
Description copied from interface:StmtContextReturn effective substatements. These are the statements which are added as this statement's substatements complete their effective model phase.- Specified by:
effectiveSubstatementsin interfaceStmtContext<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:
- Collection of declared substatements
-
mutableEffectiveSubstatements
@NonNull Collection<? extends @NonNull StmtContext.Mutable<?,?, mutableEffectiveSubstatements()?>> -
newInferenceAction
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, void addContextN extends StatementNamespace<K, ?, ?>> (Class<@NonNull N> namespace, KT key, StmtContext<?, ?, ?> stmt) Adds s statement to namespace map with a key.- Parameters:
namespace-StatementNamespacechild that determines namespace to be added tokey- of type according to namespace class specificationstmt- to be added to namespace map
-
setRootVersion
Set version of root statement context.- Parameters:
version- of root statement context
-
addRequiredSource
void addRequiredSource(org.opendaylight.yangtools.yang.model.repo.api.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
-
addEffectiveSubstatement
Adds an effective statement to collection of substatements.- Parameters:
substatement- substatement- Throws:
IllegalStateException- if added in declared phaseNullPointerException- ifsubstatementis null
-
addEffectiveSubstatements
Adds an effective statement to collection of substatements.- Parameters:
statements- substatements- Throws:
IllegalStateException- if added in declared phaseNullPointerException- if statement parameter is null
-
createUndeclaredSubstatement
@Beta <X,Y extends org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement<X>, @NonNull StmtContext.Mutable<X,Z extends org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement<X, Y>> Y, createUndeclaredSubstatementZ> (StatementSupport<X, Y, Z> support, @Nullable X arg) Create a purely-effective substatement. The statement will report anullEffectiveStatement.getDeclared()object. A typical example of statements which require this mechanics arerpcandactionstatements, which always haveinputandoutputsubstatements, even if those are not declared in YANG text. The returned context is not added to this context's substatements. That needs to done once the statement is completely defined throughaddEffectiveSubstatement(Mutable)-- which will triggerStatementSupport.onFullDefinitionDeclared(Mutable).- Parameters:
support- Statement support of the statement being createdarg- Effective argument. If specified asnull, statement support will be consulted for the empty argument.- Returns:
- A new statement
- Throws:
IllegalArgumentException- ifsupportdoes not implementUndeclaredStatementFactoryIllegalStateException- if added in declared phaseNullPointerException- ifsupportis null
-
removeStatementFromEffectiveSubstatements
@Beta void removeStatementFromEffectiveSubstatements(org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition statementDef) -
removeStatementFromEffectiveSubstatements
@Beta void removeStatementFromEffectiveSubstatements(org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition statementDef, String statementArg) Removes a statement context from the effective substatements based on its statement definition (i.e statement keyword) and raw (in String form) statement argument. The statement context is removed only if both statement definition and statement argument match with one of the effective substatements' statement definition and argument.If the statementArg parameter is null, the statement context is removed based only on its statement definition.
- Parameters:
statementDef- statement definition of the statement context to removestatementArg- statement argument of the statement context to remove
-
hasImplicitParentSupport
@Beta boolean hasImplicitParentSupport() -
wrapWithImplicit
-
addAsEffectOfStatement
-
setRootIdentifier
void setRootIdentifier(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier identifier) Set identifier of current root context.- Parameters:
identifier- of current root context, must not be null
-
setUnsupported
void setUnsupported()
-