public class Context extends java.lang.Object implements Collectible, ModelInstanceAware, EntityWithId, ModelIdentifiable, EvaluationLevelAware
Value.| Modifier | Constructor and Description |
|---|---|
protected |
Context(Context context,
ModelInstance targetModelInstance) |
|
Context(long id,
ModelInstance modelInstance,
Context parentContext,
com.whitestein.lsps.model.ContextModelElement element)
Creates new instance of
Context for given ProcessModel. |
|
Context(long id,
ModelInstance modelInstance,
Context parentContext,
java.lang.String name)
Creates new instance of
Context. |
|
Context(long id,
ModelInstance modelInstance,
Context parentContext,
java.lang.String name,
java.lang.String level,
long baseLevelContextId,
Context lowerLevelContext)
Creates new instance of
Context. |
|
Context(ModelInstance modelInstance,
Context parentContext,
com.whitestein.lsps.model.ContextModelElement element)
Creates new instance of
Context for given ProcessModel. |
|
Context(ModelInstance modelInstance,
Context parentContext,
java.lang.String name)
Creates new instance of
Context. |
|
Context(ModelInstance modelInstance,
Context parentContext,
java.lang.String name,
java.lang.String level,
long baseLevelContextId,
Context lowerLevelContext)
Creates new instance of
Context. |
protected |
Context(SContext source,
Context parentContext,
ModelInstance modelInstance)
Creates a new instance from the serialized companion.
|
| Modifier and Type | Method and Description |
|---|---|
Context |
addChildContext(Context context)
Adds context as child of this context.
|
Context |
addNewChildContext(com.whitestein.lsps.model.ContextModelElement element)
Adds new child context.
|
Context |
addNewChildContext(java.lang.String name)
Adds new child context.
|
Context |
addNewChildContext(java.lang.String name,
java.util.Map<FreeType,Type> freeTypeMapping)
Adds new child context.
|
Variable |
addNewVariable(java.lang.String name,
java.lang.String type)
Deprecated.
|
Variable |
addNewVariable(java.lang.String name,
java.lang.String type,
Type compiledType,
Value value,
boolean isReadOnly)
Adds a new variable.
|
Variable |
addNewVariable(java.lang.String name,
java.lang.String type,
Value value,
boolean isReadOnly)
Deprecated.
|
Variable |
addNewVariable(java.lang.String name,
Type type)
Adds a new variable.
|
Variable |
addNewVariable(java.lang.String name,
Type type,
Value value,
boolean isReadOnly)
Adds a new variable.
|
Variable |
addVariable(Variable var)
Adds new variable.
|
void |
addVariables(java.util.Collection<? extends Variable> variables)
Adds several variables.
|
void |
clear()
Clears variables.
|
protected NamespaceModel |
clearNamespaceModel() |
void |
collect()
Removes itself from the process.
|
void |
collectTree()
Collects this context and all its children (recursivelly).
|
boolean |
containsVariable(java.lang.String name)
Returns true if this context contains variable with given name.
|
protected void |
convertToDirectReferences() |
void |
convertToRemovedRecordContext(ModelProvider modelProvider)
Do not use this method!
This method is used only in evaluation levels merge.
|
Context |
createCopy(ModelInstance targetModelInstance)
Creates a copy without references to other objects.
|
Context |
createInLevel(java.lang.String level,
Context parentContext,
CommonRecordValue record,
Context lowerLevelContext)
Creates a context on a given level.
|
protected NamespaceModel |
createNamespaceModel(ModelProvider modelProvider)
Creates namespace model for this.
|
Variable |
createVariable(java.lang.String name,
java.lang.String type,
Type compiledType,
Value value,
boolean isReadOnly)
Creates a variable but does not add it to the context yet.
|
void |
finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source,
CopyHelper helper)
Copy references.
|
static Context |
fromSerializable(SContext source,
Context parentContext,
ModelInstance modelInstance)
Creates a new instance from the serialized companion.
|
java.util.Set<java.lang.String> |
getAllFreeTypeNames()
Returns all free type names.
|
Context |
getBaseLevelEntity()
Returns base level context.
|
long |
getBaseLevelEntityId()
Returns id of the corresponding context in base level.
|
java.util.Collection<Context> |
getChildContexts()
Returns immutable collection of child contexts.
|
CompiledNamespace |
getCompiled()
Returns instance of namespace compiled to java.
|
Type |
getCompiledType(ModelProvider modelProvider,
java.lang.String typeName)
Returns the compiled type.
|
com.whitestein.lsps.model.ContextModelElement |
getElement(ModelProvider modelProvider)
Returns the model element.
|
java.lang.String |
getElementId()
Returns the element id.
|
java.lang.String |
getElementId(ModelProvider modelProvider)
Returns the model element id.
|
java.lang.String |
getEvaluationLevel()
Returns evaluation level of this value.
|
ContextFreeType |
getFreeType(java.lang.String name)
Returns free type value for given name or null if it does not exist.
|
FreeTypeMapping |
getFreeTypeMapping(ModelProvider modelProvider)
Returns free type mappings for this context.
|
long |
getId()
Returns the id.
|
Context |
getLowerLevelEntity()
Returns lower level context.
|
java.lang.Long |
getLowerLevelEntityId()
Returns id of the corresponding context in previous lower level.
|
Context |
getLowestLevelEntity()
Returns lowest level context.
|
ModelInstance |
getModelInstance()
Returns the model instance.
|
java.lang.String |
getName()
Returns name of this context.
|
NamespaceModel |
getNamespaceModel(ModelProvider modelProvider)
Returns namespace model
|
Context |
getParentContext()
Returns the parent context or null if this is top module context.
|
java.lang.String |
getPath()
Returns the full path to this element as a string.
|
QID |
getPathQID()
Returns the full path to this element as a QID.
|
ProcessInstance |
getProcessInstance()
Returns the process instance containing this context, can be null.
|
CommonRecordValue |
getRecordValue()
Returns record value.
|
java.lang.Long |
getRecordValueId()
Returns id of record value.
|
java.util.Collection<Collectible> |
getReferences()
Returns collection of all referenced collectible objects.
|
Context |
getTopContext()
Returns the top module context.
|
Variable |
getVariableInstance(java.lang.String name)
Returns variable instance by variable name or null if it does not exist.
|
java.util.Set<java.lang.String> |
getVariableNames()
Returns the names of the variables.
|
java.util.Collection<Variable> |
getVariables()
Returns an immutable collection of variables.
|
Value |
getVariableValue(java.lang.String name)
Returns variable value for given name or null if it does not exist.
|
boolean |
hasParent(Context ctx)
Returns true if any of the parents (not only direct one) is the specified context.
|
boolean |
isPersistent()
Returns true if this object cannot be collected.
|
Context |
makeCopy(ModelInstance targetModelInstance)
Returns deep copy.
|
void |
rebind(ModelInstance modelInstance)
Re-binds to a model instance.
|
void |
refreshDirectReferences()
Re-set references to elements from the same model instance.
|
boolean |
removeChildContext(Context context)
Removes a child context.
|
void |
replaceReferencedIds(java.util.Map<java.lang.Long,java.lang.Long> replacementMap)
Replace referenced ids according to mappings in the replacement map.
|
void |
setCompiled(CompiledNamespace compiled)
Sets instance of namespace compiled to java
|
void |
setLowerLevelEntity(Context lowerLevelEntity)
Sets lower level entity.
|
void |
setVariables(java.util.Collection<? extends Variable> variables)
Sets variables.
|
void |
setVariableValue(java.lang.String name,
Value value)
Sets variable value for given name.
|
SContext |
toSerializable(SContext parent,
SModelInstance smi,
MarshallerConfig config)
Creates a serializable object.
|
java.lang.String |
toString() |
public Context(long id,
ModelInstance modelInstance,
Context parentContext,
java.lang.String name,
java.lang.String level,
long baseLevelContextId,
Context lowerLevelContext)
Context.id - modelInstance - parentContext - name - level - baseLevelContextId - lowerLevelContext - java.lang.NullPointerException - if moduleInstance or namepublic Context(ModelInstance modelInstance, Context parentContext, java.lang.String name, java.lang.String level, long baseLevelContextId, Context lowerLevelContext)
Context.modelInstance - parentContext - name - level - baseLevelContextId - lowerLevelContext - java.lang.NullPointerException - if moduleInstance or namepublic Context(long id,
ModelInstance modelInstance,
Context parentContext,
java.lang.String name)
Context.id - modelInstance - parentContext - name - java.lang.NullPointerException - if moduleInstance or namepublic Context(ModelInstance modelInstance, Context parentContext, java.lang.String name)
Context.modelInstance - parentContext - name - java.lang.NullPointerException - if moduleInstance or namepublic Context(ModelInstance modelInstance, Context parentContext, com.whitestein.lsps.model.ContextModelElement element)
Context for given ProcessModel.
It creates the context as a top context.modelInstance - parentContext - element - java.lang.NullPointerException - if modelInstance or moduleInstance or
element is nullpublic Context(long id,
ModelInstance modelInstance,
Context parentContext,
com.whitestein.lsps.model.ContextModelElement element)
Context for given ProcessModel.
It creates the context as a top context.id - modelInstance - parentContext - element - java.lang.NullPointerException - if modelInstance or moduleInstance or
element is nullprotected Context(SContext source, Context parentContext, ModelInstance modelInstance)
source - parentContext - modelInstance - protected Context(Context context, ModelInstance targetModelInstance)
public static Context fromSerializable(SContext source, Context parentContext, ModelInstance modelInstance)
source - parentContext - modelInstance - public SContext toSerializable(SContext parent, SModelInstance smi, MarshallerConfig config)
parent - smi - config - public long getId()
EntityWithIdgetId in interface EntityWithIdpublic java.lang.String getName()
public java.lang.Long getRecordValueId()
public CommonRecordValue getRecordValue()
public QID getPathQID()
public java.lang.String getPath()
public Context getParentContext()
public Context getTopContext()
public boolean hasParent(Context ctx)
ctx - public java.util.Collection<Context> getChildContexts()
public Context addChildContext(Context context)
context - public boolean removeChildContext(Context context)
context - public Context addNewChildContext(com.whitestein.lsps.model.ContextModelElement element)
element - java.lang.NullPointerException - if element is nullpublic Context addNewChildContext(java.lang.String name)
name - java.lang.NullPointerException - if name is nullpublic Context addNewChildContext(java.lang.String name, java.util.Map<FreeType,Type> freeTypeMapping)
name - freeTypeMapping - java.lang.NullPointerException - if name is nullpublic boolean containsVariable(java.lang.String name)
name - variable namepublic java.util.Collection<Variable> getVariables()
public java.util.Set<java.lang.String> getVariableNames()
public Variable getVariableInstance(java.lang.String name)
name - public Value getVariableValue(java.lang.String name)
name - public void setVariableValue(java.lang.String name,
Value value)
name - value - java.lang.IllegalArgumentException - if given variable does not existjava.lang.NullPointerException - if value is nullpublic java.lang.String getElementId()
public java.lang.String getElementId(ModelProvider modelProvider)
ModelIdentifiablegetElementId in interface ModelIdentifiablepublic com.whitestein.lsps.model.ContextModelElement getElement(ModelProvider modelProvider)
ModelIdentifiablegetElement in interface ModelIdentifiablepublic boolean isPersistent()
CollectibleisPersistent in interface Collectiblepublic java.util.Collection<Collectible> getReferences()
CollectiblegetReferences in interface Collectiblepublic void collect()
Collectiblecollect in interface Collectiblepublic void collectTree()
public Variable addVariable(Variable var)
var - java.lang.IllegalArgumentException - if a variable with the same name already existpublic void addVariables(java.util.Collection<? extends Variable> variables)
variables - public void setVariables(java.util.Collection<? extends Variable> variables)
variables - protected NamespaceModel clearNamespaceModel()
@Deprecated public Variable addNewVariable(java.lang.String name, java.lang.String type)
addNewVariable(String, Type)name - type - java.lang.IllegalArgumentException - if a variable with the same name already existpublic Variable addNewVariable(java.lang.String name, Type type)
name - type - java.lang.IllegalArgumentException - if a variable with the same name already exist@Deprecated public Variable addNewVariable(java.lang.String name, java.lang.String type, Value value, boolean isReadOnly)
addNewVariable(String, Type, Value, boolean)name - type - value - isReadOnly - java.lang.IllegalArgumentException - if a variable with the same name already existpublic Variable addNewVariable(java.lang.String name, Type type, Value value, boolean isReadOnly)
name - type - value - isReadOnly - java.lang.IllegalArgumentException - if a variable with the same name already existpublic Variable addNewVariable(java.lang.String name, java.lang.String type, Type compiledType, Value value, boolean isReadOnly)
name - type - compiledType - a compiled type if known, may be nullvalue - isReadOnly - java.lang.IllegalArgumentException - if a variable with the same name already existpublic Variable createVariable(java.lang.String name, java.lang.String type, Type compiledType, Value value, boolean isReadOnly)
name - type - compiledType - value - isReadOnly - public ContextFreeType getFreeType(java.lang.String name)
name - java.lang.NullPointerException - if name is nullpublic ProcessInstance getProcessInstance()
public ModelInstance getModelInstance()
ModelInstanceAwaregetModelInstance in interface ModelInstanceAwarepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getEvaluationLevel()
getEvaluationLevel in interface EvaluationLevelAwarepublic long getBaseLevelEntityId()
getBaseLevelEntityId in interface EvaluationLevelAwarepublic Context getBaseLevelEntity()
getBaseLevelEntity in interface EvaluationLevelAwarepublic Context getLowestLevelEntity()
public java.lang.Long getLowerLevelEntityId()
getLowerLevelEntityId in interface EvaluationLevelAwarepublic Context getLowerLevelEntity()
getLowerLevelEntity in interface EvaluationLevelAwarepublic void setLowerLevelEntity(Context lowerLevelEntity)
lowerLevelEntity - public NamespaceModel getNamespaceModel(ModelProvider modelProvider)
modelProvider - protected NamespaceModel createNamespaceModel(ModelProvider modelProvider)
modelProvider - public FreeTypeMapping getFreeTypeMapping(ModelProvider modelProvider)
modelProvider - public java.util.Set<java.lang.String> getAllFreeTypeNames()
public Type getCompiledType(ModelProvider modelProvider, java.lang.String typeName)
modelProvider - typeName - public void replaceReferencedIds(java.util.Map<java.lang.Long,java.lang.Long> replacementMap)
replaceReferencedIds in interface EvaluationLevelAwarereplacementMap - public void rebind(ModelInstance modelInstance)
rebind in interface ModelInstanceAwaremodelInstance - public void clear()
clear in interface EvaluationLevelAwarepublic Context createCopy(ModelInstance targetModelInstance)
public void finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source,
CopyHelper helper)
public final Context makeCopy(ModelInstance targetModelInstance)
targetModelInstance - public CompiledNamespace getCompiled()
public void setCompiled(CompiledNamespace compiled)
compiled - protected void convertToDirectReferences()
public void refreshDirectReferences()
EvaluationLevelAwarerefreshDirectReferences in interface EvaluationLevelAwarepublic Context createInLevel(java.lang.String level, Context parentContext, CommonRecordValue record, Context lowerLevelContext)
level - parentContext - record - lowerLevelContext - public void convertToRemovedRecordContext(ModelProvider modelProvider)
modelProvider - Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.