public abstract class StatementContextBase<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>> extends Object implements StmtContext.Mutable<A,D,E>, StatementWriter.ResumedStatement
StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
Modifier and Type | Method and Description |
---|---|
void |
addAsEffectOfStatement(Collection<? extends StmtContext<?,?,?>> ctxs) |
void |
addAsEffectOfStatement(StmtContext<?,?,?> ctx) |
<K,KT extends K,N extends StatementNamespace<K,?,?>> |
addContext(Class<N> namespace,
KT key,
StmtContext<?,?,?> stmt)
Adds s statement to namespace map with a key.
|
<K,N extends StatementNamespace<K,?,?>> |
addContextToNamespace(Class<N> type,
K key,
StmtContext<?,?,?> value)
Associate a context with a key within a namespace.
|
void |
addEffectiveSubstatement(StmtContext.Mutable<?,?,?> substatement)
Adds an effective statement to collection of substatements.
|
void |
addEffectiveSubstatements(Collection<? extends StmtContext.Mutable<?,?,?>> statements)
Adds an effective statement to collection of substatements.
|
<K,V,T extends K,U extends V,N extends IdentifierNamespace<K,V>> |
addToNs(Class<N> type,
T key,
U value)
Associate a value with a key within a namespace.
|
protected com.google.common.base.MoreObjects.ToStringHelper |
addToStringAttributes(com.google.common.base.MoreObjects.ToStringHelper toStringHelper) |
void |
appendImplicitStatement(StatementSupport<?,?,?> statementToAdd) |
D |
buildDeclared()
Builds
DeclaredStatement for statement context. |
E |
buildEffective()
Builds
EffectiveStatement for statement context. |
protected void |
checkLocalNamespaceAllowed(Class<? extends IdentifierNamespace<?,?>> type) |
<X,Y extends DeclaredStatement<X>,Z extends EffectiveStatement<X,Y>> |
childCopyOf(StmtContext<X,Y,Z> stmt,
CopyType type,
QNameModule targetModule)
Create a child sub-statement, which is a child of this statement, inheriting all attributes from specified
child and recording copy type.
|
<X,Y extends DeclaredStatement<X>,Z extends EffectiveStatement<X,Y>> |
createSubstatement(int offset,
StatementDefinitionContext<X,Y,Z> def,
StatementSourceReference ref,
String argument)
Create a new substatement at the specified offset.
|
Collection<? extends StmtContext<?,?,?>> |
declaredSubstatements()
Return declared substatements.
|
protected @NonNull StatementDefinitionContext<A,D,E> |
definition()
Return the context in which this statement was defined.
|
Collection<? extends StmtContext<?,?,?>> |
effectiveSubstatements()
Return effective substatements.
|
<K,V,N extends IdentifierNamespace<K,V>> |
getAllFromCurrentStmtCtxNamespace(Class<N> type) |
<K,V,N extends IdentifierNamespace<K,V>> |
getAllFromLocalStorage(Class<N> type) |
<K,V,N extends IdentifierNamespace<K,V>> |
getAllFromNamespace(Class<N> type) |
abstract NamespaceBehaviour.Registry |
getBehaviourRegistry()
Return the registry of a source context.
|
ModelProcessingPhase |
getCompletedPhase() |
CopyHistory |
getCopyHistory() |
@NonNull StatementDefinition |
getDefinition()
Return statement definition.
|
Collection<? extends StmtContext<?,?,?>> |
getEffectOfStatement() |
<K,V,N extends IdentifierNamespace<K,V>> |
getFromLocalStorage(Class<N> type,
K key) |
<K,V,N extends IdentifierNamespace<K,V>> |
getFromNamespace(Class<N> type,
NamespaceKeyCriterion<K> criterion) |
<K,V,T extends K,N extends IdentifierNamespace<K,V>> |
getFromNamespace(Class<N> type,
T key)
Return a value associated with specified key within a namespace.
|
Optional<StmtContext<?,?,?>> |
getOriginalCtx() |
abstract StatementContextBase<?,?,?> |
getParentContext()
Return the parent statement context, or null if this is the root statement.
|
abstract NamespaceBehaviour.NamespaceStorageNode |
getParentNamespaceStorage() |
StatementDefinition |
getPublicDefinition()
|
abstract RootStatementContext<?,?,?> |
getRoot()
Returns the model root for this statement.
|
@NonNull StatementSourceReference |
getSourceReference()
Return statement source reference.
|
StatementSource |
getStatementSource()
Returns the origin of the statement.
|
StatementSourceReference |
getStatementSourceReference()
Returns a reference to statement source.
|
boolean |
isFullyDefined()
Check if the statement has been fully defined.
|
protected abstract boolean |
isIgnoringConfig() |
protected abstract boolean |
isIgnoringIfFeatures() |
protected abstract boolean |
isParentSupportedByFeatures() |
boolean |
isSupportedByFeatures() |
boolean |
isSupportedToBuildEffective() |
Collection<? extends StmtContext.Mutable<?,?,?>> |
mutableDeclaredSubstatements() |
Collection<? extends StmtContext.Mutable<?,?,?>> |
mutableEffectiveSubstatements() |
ModelActionBuilder |
newInferenceAction(ModelProcessingPhase phase)
Create a new inference action to be executed during specified phase.
|
protected <K,V,N extends IdentifierNamespace<K,V>> |
onNamespaceElementAdded(Class<N> type,
K key,
V value)
Occurs when an item is added to model namespace.
|
<K,V,N extends IdentifierNamespace<K,V>> |
putToLocalStorage(Class<N> type,
K key,
V value)
Populate specified namespace with a key/value pair, overwriting previous contents.
|
<K,V,N extends IdentifierNamespace<K,V>> |
putToLocalStorageIfAbsent(Class<N> type,
K key,
V value)
Populate specified namespace with a key/value pair unless the key is already associated with a value.
|
String |
rawStatementArgument()
Return the statement argument in literal format.
|
void |
removeStatementFromEffectiveSubstatements(StatementDefinition statementDef) |
void |
removeStatementFromEffectiveSubstatements(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.
|
void |
removeStatementsFromEffectiveSubstatements(Collection<? extends StmtContext<?,?,?>> statements) |
void |
setCompletedPhase(ModelProcessingPhase completedPhase) |
void |
setIsSupportedToBuildEffective(boolean isSupportedToBuildEffective) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addMutableStmtToSeal, addRequiredSource, addToNs, childCopyOf, coerceParentContext, setRootIdentifier, setRootVersion
allSubstatements, allSubstatementsStream, coerceRawStatementArgument, coerceStatementArgument, getAllFromCurrentStmtCtxNamespace, getAllFromNamespace, getFromNamespace, getRootVersion, getSchemaPath, getStatementArgument, isConfiguration, isEnabledSemanticVersioning
getStorageNodeType
public Collection<? extends StmtContext<?,?,?>> getEffectOfStatement()
getEffectOfStatement
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public void addAsEffectOfStatement(StmtContext<?,?,?> ctx)
addAsEffectOfStatement
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public void addAsEffectOfStatement(Collection<? extends StmtContext<?,?,?>> ctxs)
addAsEffectOfStatement
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public boolean isSupportedByFeatures()
isSupportedByFeatures
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
protected abstract boolean isParentSupportedByFeatures()
protected abstract boolean isIgnoringIfFeatures()
protected abstract boolean isIgnoringConfig()
public boolean isSupportedToBuildEffective()
isSupportedToBuildEffective
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public void setIsSupportedToBuildEffective(boolean isSupportedToBuildEffective)
setIsSupportedToBuildEffective
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public CopyHistory getCopyHistory()
getCopyHistory
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public Optional<StmtContext<?,?,?>> getOriginalCtx()
getOriginalCtx
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public ModelProcessingPhase getCompletedPhase()
getCompletedPhase
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public void setCompletedPhase(ModelProcessingPhase completedPhase)
setCompletedPhase
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public abstract StatementContextBase<?,?,?> getParentContext()
StmtContext
getParentContext
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
getParentContext
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public abstract RootStatementContext<?,?,?> getRoot()
getRoot
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
getRoot
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public StatementSource getStatementSource()
getStatementSource
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public StatementSourceReference getStatementSourceReference()
getStatementSourceReference
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public final String rawStatementArgument()
StmtContext
rawStatementArgument
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public Collection<? extends StmtContext<?,?,?>> declaredSubstatements()
StmtContext
declaredSubstatements
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public Collection<? extends StmtContext.Mutable<?,?,?>> mutableDeclaredSubstatements()
mutableDeclaredSubstatements
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public Collection<? extends StmtContext<?,?,?>> effectiveSubstatements()
StmtContext
effectiveSubstatements
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public Collection<? extends StmtContext.Mutable<?,?,?>> mutableEffectiveSubstatements()
mutableEffectiveSubstatements
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public void removeStatementsFromEffectiveSubstatements(Collection<? extends StmtContext<?,?,?>> statements)
public void removeStatementFromEffectiveSubstatements(StatementDefinition statementDef)
public void removeStatementFromEffectiveSubstatements(StatementDefinition statementDef, String statementArg)
If the statementArg parameter is null, the statement context is removed based only on its statement definition.
statementDef
- statement definition of the statement context to removestatementArg
- statement argument of the statement context to removepublic void addEffectiveSubstatement(StmtContext.Mutable<?,?,?> substatement)
substatement
- substatementIllegalStateException
- if added in declared phaseNullPointerException
- if statement parameter is nullpublic void addEffectiveSubstatements(Collection<? extends StmtContext.Mutable<?,?,?>> statements)
statements
- substatementsIllegalStateException
- if added in declared phaseNullPointerException
- if statement parameter is nullpublic final <X,Y extends DeclaredStatement<X>,Z extends EffectiveStatement<X,Y>> StatementContextBase<X,Y,Z> createSubstatement(int offset, StatementDefinitionContext<X,Y,Z> def, StatementSourceReference ref, String argument)
X
- new substatement argument typeY
- new substatement declared typeZ
- new substatement effective typeoffset
- Substatement offsetdef
- definition contextref
- source referenceargument
- statement argumentpublic void appendImplicitStatement(StatementSupport<?,?,?> statementToAdd)
public D buildDeclared()
StmtContext
DeclaredStatement
for statement context.buildDeclared
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public E buildEffective()
StmtContext
EffectiveStatement
for statement context.buildEffective
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
protected final @NonNull StatementDefinitionContext<A,D,E> definition()
protected void checkLocalNamespaceAllowed(Class<? extends IdentifierNamespace<?,?>> type)
protected <K,V,N extends IdentifierNamespace<K,V>> void onNamespaceElementAdded(Class<N> type, K key, V value)
public StatementDefinition getPublicDefinition()
getPublicDefinition
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public ModelActionBuilder newInferenceAction(ModelProcessingPhase phase)
StmtContext.Mutable
newInferenceAction
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
phase
- Target phase in which the action will resolved.public <K,KT extends K,N extends StatementNamespace<K,?,?>> void addContext(Class<N> namespace, KT key, StmtContext<?,?,?> stmt)
StmtContext.Mutable
addContext
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
namespace
- StatementNamespace
child that determines namespace to be added tokey
- of type according to namespace class specificationstmt
- to be added to namespace mappublic <X,Y extends DeclaredStatement<X>,Z extends EffectiveStatement<X,Y>> StmtContext.Mutable<X,Y,Z> childCopyOf(StmtContext<X,Y,Z> stmt, CopyType type, QNameModule targetModule)
StmtContext.Mutable
childCopyOf
in interface StmtContext.Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
stmt
- Statement to be used as a templatetype
- Type of copy to record in historytargetModule
- Optional new target moduleCopyType
(augment, uses)public @NonNull StatementDefinition getDefinition()
StatementWriter.ResumedStatement
getDefinition
in interface StatementWriter.ResumedStatement
public @NonNull StatementSourceReference getSourceReference()
StatementWriter.ResumedStatement
getSourceReference
in interface StatementWriter.ResumedStatement
public boolean isFullyDefined()
StatementWriter.ResumedStatement
isFullyDefined
in interface StatementWriter.ResumedStatement
protected com.google.common.base.MoreObjects.ToStringHelper addToStringAttributes(com.google.common.base.MoreObjects.ToStringHelper toStringHelper)
public abstract NamespaceBehaviour.NamespaceStorageNode getParentNamespaceStorage()
getParentNamespaceStorage
in interface NamespaceBehaviour.NamespaceStorageNode
public abstract NamespaceBehaviour.Registry getBehaviourRegistry()
public final <K,V,T extends K,N extends IdentifierNamespace<K,V>> V getFromNamespace(Class<N> type, T key)
K
- namespace key typeV
- namespace value typeN
- namespace typeT
- key typetype
- Namespace typekey
- KeyNamespaceNotAvailableException
- when the namespace is not available.public final <K,V,N extends IdentifierNamespace<K,V>> Optional<Map.Entry<K,V>> getFromNamespace(Class<N> type, NamespaceKeyCriterion<K> criterion)
public final <K,V,N extends IdentifierNamespace<K,V>> Map<K,V> getAllFromNamespace(Class<N> type)
public final <K,V,N extends IdentifierNamespace<K,V>> Map<K,V> getAllFromCurrentStmtCtxNamespace(Class<N> type)
public final <K,V,T extends K,U extends V,N extends IdentifierNamespace<K,V>> void addToNs(Class<N> type, T key, U value)
K
- namespace key typeV
- namespace value typeN
- namespace typeT
- key typeU
- value typetype
- Namespace typekey
- Keyvalue
- valueNamespaceNotAvailableException
- when the namespace is not available.public final <K,N extends StatementNamespace<K,?,?>> void addContextToNamespace(Class<N> type, K key, StmtContext<?,?,?> value)
K
- namespace key typeN
- namespace typetype
- Namespace typekey
- Keyvalue
- Context valueNamespaceNotAvailableException
- when the namespace is not available.public <K,V,N extends IdentifierNamespace<K,V>> V getFromLocalStorage(Class<N> type, K key)
getFromLocalStorage
in interface NamespaceBehaviour.NamespaceStorageNode
public <K,V,N extends IdentifierNamespace<K,V>> Map<K,V> getAllFromLocalStorage(Class<N> type)
getAllFromLocalStorage
in interface NamespaceBehaviour.NamespaceStorageNode
public <K,V,N extends IdentifierNamespace<K,V>> V putToLocalStorage(Class<N> type, K key, V value)
NamespaceBehaviour.NamespaceStorageNode
Map.put(Object, Object)
.putToLocalStorage
in interface NamespaceBehaviour.NamespaceStorageNode
type
- Namespace identifierkey
- Keyvalue
- Valuepublic <K,V,N extends IdentifierNamespace<K,V>> V putToLocalStorageIfAbsent(Class<N> type, K key, V value)
NamespaceBehaviour.NamespaceStorageNode
Map.putIfAbsent(Object, Object)
.putToLocalStorageIfAbsent
in interface NamespaceBehaviour.NamespaceStorageNode
type
- Namespace identifierkey
- Keyvalue
- ValueCopyright © 2019 OpenDaylight. All rights reserved.