Interface StmtContext<A,D extends DeclaredStatement<A>,E extends 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>
- All Known Implementing Classes:
RootStatementContext
,StatementContextBase
public interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>> extends NamespaceStmtCtx, BoundStmtCtxCompat<A,D>
An inference context associated with an instance of a statement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
An mutable view of an inference context associated with an instance of a statement.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Iterable<? extends StmtContext<?,?,?>>
allSubstatements()
default Stream<? extends StmtContext<?,?,?>>
allSubstatementsStream()
@NonNull E
buildEffective()
Return theEffectiveStatement
for statement context, creating it if required.default @NonNull StmtContext<?,?,?>
coerceParentContext()
Return the parent statement context, forcing a VerifyException if this is the root statement.default @NonNull String
coerceRawStatementArgument()
Deprecated, for removal: This API element is subject to removal in a future version.UseCommonStmtCtx.getRawArgument()
instead.default @NonNull A
coerceStatementArgument()
Deprecated, for removal: This API element is subject to removal in a future version.UseBoundStmtCtx.getArgument()
instead.@NonNull Collection<? extends StmtContext<?,?,?>>
declaredSubstatements()
Return declared substatements.@NonNull Collection<? extends StmtContext<?,?,?>>
effectiveSubstatements()
Return effective substatements.ModelProcessingPhase
getCompletedPhase()
Collection<? extends StmtContext<?,?,?>>
getEffectOfStatement()
Optional<StmtContext<A,D,E>>
getOriginalCtx()
Return the statement context of the original definition, if this statement is an instantiated copy.@Nullable StmtContext<?,?,?>
getParentContext()
Return the parent statement context, or null if this is the root statement.Optional<StmtContext<A,D,E>>
getPreviousCopyCtx()
Return the context of the previous copy of this statement -- effectively walking towards the source origin of this statement.default @NonNull StatementDefinition
getPublicDefinition()
Deprecated, for removal: This API element is subject to removal in a future version.@NonNull RootStmtContext<?,?,?>
getRoot()
Returns the model root for this statement.default @Nullable A
getStatementArgument()
Deprecated, for removal: This API element is subject to removal in a future version.UseBoundStmtCtx.argument()
instead.default @NonNull StatementOrigin
getStatementSource()
Deprecated, for removal: This API element is subject to removal in a future version.default @NonNull StatementSourceReference
getStatementSourceReference()
Deprecated, for removal: This API element is subject to removal in a future version.boolean
isSupportedByFeatures()
boolean
isSupportedToBuildEffective()
default @Nullable String
rawStatementArgument()
Deprecated, for removal: This API element is subject to removal in a future version.UseCommonStmtCtx.rawArgument()
instead.-
Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.BoundStmtCtx
argument, findSubstatementArgument, getArgument, hasSubstatement, yangVersion
-
Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.BoundStmtCtxCompat
declared
-
Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.CommonStmtCtx
getRawArgument, origin, producesDeclared, producesEffective, publicDefinition, rawArgument, sourceReference
-
Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceStmtCtx
getAllFromNamespace, getFromNamespace, localNamespacePortion, namespace, namespaceItem
-
Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextCompat
history
-
-
-
-
Method Detail
-
getPublicDefinition
@Deprecated(forRemoval=true) default @NonNull StatementDefinition getPublicDefinition()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getStatementSource
@Deprecated(forRemoval=true) default @NonNull StatementOrigin getStatementSource()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getStatementSourceReference
@Deprecated(forRemoval=true) default @NonNull StatementSourceReference getStatementSourceReference()
Deprecated, for removal: This API element is subject to removal in a future version.
-
rawStatementArgument
@Deprecated(forRemoval=true) default @Nullable String rawStatementArgument()
Deprecated, for removal: This API element is subject to removal in a future version.UseCommonStmtCtx.rawArgument()
instead.Return the statement argument in literal format.- Returns:
- raw statement argument string, or null if this statement does not have an argument.
-
coerceRawStatementArgument
@Deprecated(forRemoval=true) default @NonNull String coerceRawStatementArgument()
Deprecated, for removal: This API element is subject to removal in a future version.UseCommonStmtCtx.getRawArgument()
instead.Return the statement argument in literal format.- Returns:
- raw statement argument string
- Throws:
VerifyException
- if this statement does not have an argument
-
getStatementArgument
@Deprecated(forRemoval=true) default @Nullable A getStatementArgument()
Deprecated, for removal: This API element is subject to removal in a future version.UseBoundStmtCtx.argument()
instead.Return the statement argument.- Returns:
- statement argument, or null if this statement does not have an argument
-
coerceStatementArgument
@Deprecated(forRemoval=true) default @NonNull A coerceStatementArgument()
Deprecated, for removal: This API element is subject to removal in a future version.UseBoundStmtCtx.getArgument()
instead.Return the statement argument in literal format.- Returns:
- raw statement argument string
- Throws:
VerifyException
- if this statement does not have an argument
-
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
default @NonNull StmtContext<?,?,?> coerceParentContext()
Return the parent statement context, forcing a VerifyException if this is the root statement.- Returns:
- context of parent of statement
- Throws:
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 StmtContext<?,?,?>> declaredSubstatements()
Return declared substatements. These are the statements which are explicitly written in the source model.- Returns:
- Collection of declared substatements
-
effectiveSubstatements
@NonNull Collection<? extends 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
default Iterable<? extends StmtContext<?,?,?>> allSubstatements()
-
allSubstatementsStream
default Stream<? extends StmtContext<?,?,?>> allSubstatementsStream()
-
buildEffective
@NonNull E buildEffective()
Return theEffectiveStatement
for 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,E>> getOriginalCtx()
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,E>> getPreviousCopyCtx()
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.
-
getCompletedPhase
ModelProcessingPhase getCompletedPhase()
-
-