public abstract class StatementContextBase<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>> extends Object implements StmtContext.Mutable<A,D,E>
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 statement to namespace map with the key
|
<K,N extends StatementNamespace<K,?,?>> |
addContextToNamespace(Class<N> type,
K key,
StmtContext<?,?,?> value) |
void |
addEffectiveSubstatement(StmtContext.Mutable<?,?,?> substatement)
adds effective statement to collection of substatements
|
void |
addEffectiveSubstatements(Collection<? extends StmtContext.Mutable<?,?,?>> substatements)
adds effective statement to collection of substatements
|
<K,V,KT extends K,VT extends V,N extends IdentifierNamespace<K,V>> |
addToNs(Class<N> type,
KT key,
VT value) |
protected com.google.common.base.MoreObjects.ToStringHelper |
addToStringAttributes(com.google.common.base.MoreObjects.ToStringHelper toStringHelper) |
D |
buildDeclared()
Builds
DeclaredStatement for statement context. |
E |
buildEffective()
Builds
EffectiveStatement for statement context |
protected void |
checkLocalNamespaceAllowed(Class<? extends IdentifierNamespace<?,?>> type) |
<CA,CD extends DeclaredStatement<CA>,CE extends EffectiveStatement<CA,CD>> |
createSubstatement(int offset,
StatementDefinitionContext<CA,CD,CE> def,
StatementSourceReference ref,
String argument)
Create a new substatement at the specified offset.
|
Collection<? extends StmtContext<?,?,?>> |
declaredSubstatements()
Return declared substatements.
|
protected StatementDefinitionContext<A,D,E> |
definition() |
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() |
ModelProcessingPhase |
getCompletedPhase() |
CopyHistory |
getCopyHistory() |
Collection<? extends StmtContext<?,?,?>> |
getEffectOfStatement() |
<K,V,N extends IdentifierNamespace<K,V>> |
getFromLocalStorage(Class<N> type,
K key) |
<K,V,KT extends K,N extends IdentifierNamespace<K,V>> |
getFromNamespace(Class<N> type,
KT key) |
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() |
StatementSource |
getStatementSource() |
StatementSourceReference |
getStatementSourceReference() |
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() |
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<?,?,?>> substatements) |
void |
setCompletedPhase(ModelProcessingPhase completedPhase) |
void |
setIsSupportedToBuildEffective(boolean isSupportedToBuildEffective) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addMutableStmtToSeal, addRequiredModule, addToNs, setRootIdentifier, setRootVersion
createCopy, createCopy, 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>>
@Nonnull 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>>
@Nonnull public StatementSource getStatementSource()
getStatementSource
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
@Nonnull public StatementSourceReference getStatementSourceReference()
getStatementSourceReference
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
public final String rawStatementArgument()
rawStatementArgument
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
@Nonnull public Collection<? extends StmtContext<?,?,?>> declaredSubstatements()
StmtContext
declaredSubstatements
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
@Nonnull 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>>
@Nonnull 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<?,?,?>> substatements)
public void removeStatementFromEffectiveSubstatements(StatementDefinition statementDef)
public void removeStatementFromEffectiveSubstatements(StatementDefinition statementDef, String statementArg)
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<?,?,?>> substatements)
substatements
- substatementsIllegalStateException
- if added in declared phaseNullPointerException
- if statement parameter is nullpublic final <CA,CD extends DeclaredStatement<CA>,CE extends EffectiveStatement<CA,CD>> StatementContextBase<CA,CD,CE> createSubstatement(int offset, StatementDefinitionContext<CA,CD,CE> def, StatementSourceReference ref, String argument)
offset
- Substatement offsetdef
- definition contextref
- source referenceargument
- statement argumentpublic 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 contextbuildEffective
in interface StmtContext<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A,D>>
protected final 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)
@Nonnull 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 mapprotected 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()
@Nonnull public final <K,V,KT extends K,N extends IdentifierNamespace<K,V>> V getFromNamespace(Class<N> type, KT key) throws NamespaceNotAvailableException
NamespaceNotAvailableException
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,KT extends K,VT extends V,N extends IdentifierNamespace<K,V>> void addToNs(Class<N> type, KT key, VT value) throws NamespaceNotAvailableException
NamespaceNotAvailableException
public final <K,N extends StatementNamespace<K,?,?>> void addContextToNamespace(Class<N> type, K key, StmtContext<?,?,?> value) throws NamespaceNotAvailableException
NamespaceNotAvailableException
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 © 2018 OpenDaylight. All rights reserved.