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>>
- Type Parameters:
A- Argument typeD- Declared Statement representationE- Effective Statement representation
- All Superinterfaces:
BoundStmtCtx<A>,BoundStmtCtxCompat<A,,D> CommonStmtCtx,NamespaceStmtCtx,StmtContextCompat
- All Known Subinterfaces:
RootStmtContext<A,,D, E> RootStmtContext.Mutable<A,,D, E> StmtContext.Mutable<A,D, E>
public 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>>
extends NamespaceStmtCtx, BoundStmtCtxCompat<A,D>
An inference context associated with an instance of a statement.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceStmtContext.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>> An mutable view of an inference context associated with an instance of a statement. -
Method Summary
Modifier and TypeMethodDescriptiondefault Iterable<? extends @NonNull StmtContext<?,?, ?>> default Stream<? extends @NonNull StmtContext<?,?, ?>> @NonNull EReturn theEffectiveStatementfor statement context, creating it if required.default @NonNull StmtContext<?,?, ?> 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) @NonNull Collection<? extends @NonNull StmtContext<?,?, ?>> Return declared substatements.@NonNull Collection<? extends @NonNull StmtContext<?,?, ?>> Return effective substatements.Collection<? extends StmtContext<?,?, ?>> Optional<StmtContext<A,D, E>> Return the statement context of the original definition, if this statement is an instantiated copy.@Nullable StmtContext<?,?, ?> Return the parent statement context, or null if this is the root statement.Optional<StmtContext<A,D, E>> Return the context of the previous copy of this statement -- effectively walking towards the source origin of this statement.@NonNull RootStmtContext<?,?, ?> getRoot()Returns the model root for this statement.booleanboolean@NonNull StmtContext.Mutable<A,D, E> replicaAsChildOf(StmtContext.Mutable<?, ?, ?> parent) Create a replica of this statement as a substatement of specifiedparent.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.StmtContextCompat
history
-
Method Details
-
getParentContext
@Nullable StmtContext<?,?, getParentContext()?> Return the parent statement context, or null if this is the root statement.- Returns:
- context of parent of statement, or null if this is the root statement.
-
coerceParentContext
Return the parent statement context, forcing a VerifyException if this is the root statement.- Returns:
- context of parent of statement
- Throws:
com.google.common.base.VerifyException- if this statement is the root statement
-
getRoot
@NonNull RootStmtContext<?,?, getRoot()?> Returns the model root for this statement.- Returns:
- root context of statement
-
declaredSubstatements
@NonNull Collection<? extends @NonNull StmtContext<?,?, declaredSubstatements()?>> Return 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().- Returns:
- Collection of declared substatements
-
effectiveSubstatements
@NonNull Collection<? extends @NonNull StmtContext<?,?, effectiveSubstatements()?>> Return effective substatements. These are the statements which are added as this statement's substatements complete their effective model phase.- Returns:
- Collection of declared substatements
-
allSubstatements
-
allSubstatementsStream
-
buildEffective
@NonNull E buildEffective()Return theEffectiveStatementfor statement context, creating it if required. Implementations of this method are required to memoize the returned object, so that subsequent invocation return the same object.If
isSupportedToBuildEffective()returnsfalse, this method's behaviour is undefined.- Returns:
- Effective statement instance.
-
isSupportedToBuildEffective
boolean isSupportedToBuildEffective() -
isSupportedByFeatures
boolean isSupportedByFeatures() -
getEffectOfStatement
Collection<? extends StmtContext<?,?, getEffectOfStatement()?>> -
getOriginalCtx
Optional<StmtContext<A,D, getOriginalCtx()E>> Return the statement context of the original definition, if this statement is an instantiated copy.- Returns:
- Original definition, if this statement was copied.
-
getPreviousCopyCtx
Optional<StmtContext<A,D, getPreviousCopyCtx()E>> Return the context of the previous copy of this statement -- effectively walking towards the source origin of this statement.- Returns:
- Context of the previous copy of this statement, if this statement has been copied.
-
replicaAsChildOf
Create a replica of this statement as a substatement of specifiedparent. The replica must not be modified and acts as a source ofEffectiveStatementfrom outside ofparent's subtree.- Parameters:
parent- Parent of the replica statement- Returns:
- replica of this statement
- Throws:
IllegalArgumentException- if this statement cannot be replicated into parent, for example because it comes from an alien implementation.
-
copyAsChildOf
@Beta @NonNull Optional<? extends StmtContext.Mutable<?,?, copyAsChildOf?>> (StmtContext.Mutable<?, ?, ?> parent, CopyType type, @Nullable QNameModule targetModule) -
getCompletedPhase
ModelProcessingPhase getCompletedPhase()
-