public abstract class AbstractContextNamespace extends Object implements Namespace, JavaOperationExecutor
Constructor and Description |
---|
AbstractContextNamespace(ModelProvider modelProvider,
Context context)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
protected Namespace |
createChildNamespaceInternal(String name,
List<? extends Field> fields,
List<?> values,
Map<FreeType,Type> freeTypeMapping,
InterpreterConfiguration configuration)
Creates child namespace in required evaluation level.
|
ListHolder |
createRange(long first,
long last)
Creates a range (list) defined by endpoints (both inclusive).
|
Object |
executeJavaOperation(String className,
String methodName,
Class<?>[] argClasses,
Object[] evaluatedArgs,
InterpreterStackTrace stackTrace)
Executes the operation.
|
Set<String> |
getAllFreeTypeNames()
Returns all free type names.
|
CompiledNamespace |
getCompiled() |
Object |
getCompiled(String moduleName) |
CompiledContext |
getCompiledContext(Namespace moduleNamespace,
String evaluationLevel) |
Object |
getConstantValue(String moduleName,
String constantName)
Returns the value of the constant with the given name from a (imported)
module with a given module name.
|
protected Context |
getContext()
Returns context.
|
long |
getContextId()
Returns context id.
|
protected RuntimeToPersistentConverter |
getConverter()
Returns instance of
RuntimeToPersistentConverter . |
protected EvaluationLevelConverter |
getEvaluationConverter()
Returns instance of
EvaluationLevelConverter . |
String |
getEvaluationLevel()
Returns evaluation level.
|
ExecutionContext |
getExecutionContext() |
Type |
getFreeType(FreeType type)
Returns the value of given free type or null if it does not exist in this context.
|
protected Context |
getFunctionContext(FunctionExpression expression) |
String |
getModelElementId()
Returns id of model element that is related to this namespace.
|
long |
getModelId()
Returns model id.
|
long |
getModelInstanceId()
Returns model instance id.
|
ModelProvider |
getModelProvider()
Returns the model provider
|
Collection<String> |
getModuleNames()
Returns collection of all module names.
|
String |
getName()
Returns name of this namespace.
|
protected AbstractContextNamespace |
getNamespace(Context ctx)
Returns namespace for a context.
|
AbstractContextNamespace |
getNamespaceInLevel(String level)
Returns namespace in evaluation level.
|
NamespaceModel |
getNamespaceModel()
Returns
NamespaceModel for this namespace. |
QID |
getPathQID()
Returns
QID of the context path. |
com.whitestein.lsps.model.ProcessModel |
getProcessModel()
Returns process model.
|
protected Context |
getReferencedContext(ContextReferencingExpression expression) |
RecordHolder |
getThis()
Returns object that represents this.
|
Object |
getVariableValue(String name)
Returns value of variable for given name from this namespace.
|
void |
remove()
INTERNAL API.
|
Type |
resolveType(String type)
Resolves type.
|
void |
setCompiled(Object compiledContext) |
protected void |
setVariableValueInternal(String name,
Type type,
Object value) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addNewVariable, addNewVariable, canBeInterpretedIn, containsVariable, createChildNamespace, createChildNamespace, getConfiguration, getFreeTypeMapping, getHolderFactory, getJavaObject, getLowerLevelNamespace, getModuleNamespace, getParentNamespace, getTopNamespace, getVariableNames, getVariableType, initializeVariable, isVariableReadOnly, resolveRecordType, setVariableValue
createBinaryHolder, createBinaryHolder, createClosure, createClosure, createClosure, createClosureFromExpression, createExternalRecordProxy, createList, createMap, createMap, createNonSharedRecord, createRecord, createRecord, createRecord, createRecord, createReference, createSet
public AbstractContextNamespace(ModelProvider modelProvider, Context context)
modelProvider
- context
- public ModelProvider getModelProvider()
protected Context getContext()
public String getName()
Namespace
null
and does not have to be
unique. Multiple namespaces can share same name.public com.whitestein.lsps.model.ProcessModel getProcessModel()
public NamespaceModel getNamespaceModel()
Namespace
NamespaceModel
for this namespace.getNamespaceModel
in interface Namespace
NamespaceModel
for this namespacepublic long getModelId()
Namespace
getModelId
in interface Namespace
public long getModelInstanceId()
Namespace
getModelInstanceId
in interface Namespace
public String getModelElementId()
Namespace
getModelElementId
in interface Namespace
public long getContextId()
Namespace
getContextId
in interface Namespace
protected RuntimeToPersistentConverter getConverter()
RuntimeToPersistentConverter
.protected EvaluationLevelConverter getEvaluationConverter()
EvaluationLevelConverter
.public Object getConstantValue(String moduleName, String constantName)
Namespace
getConstantValue
in interface Namespace
null
if there is no such a constantpublic Type resolveType(String type)
Namespace
resolveType
in interface Namespace
public Type getFreeType(FreeType type)
Namespace
getFreeType
in interface Namespace
protected void setVariableValueInternal(String name, Type type, Object value)
public String getEvaluationLevel()
getEvaluationLevel
in interface Namespace
public Object getVariableValue(String name)
Namespace
Null
is returned
if this namespace does not contain given variable.getVariableValue
in interface Namespace
name
- variable namepublic QID getPathQID()
Namespace
QID
of the context path.getPathQID
in interface Namespace
QID
of the context pathpublic Object executeJavaOperation(String className, String methodName, Class<?>[] argClasses, Object[] evaluatedArgs, InterpreterStackTrace stackTrace) throws ErrorException
JavaOperationExecutor
executeJavaOperation
in interface JavaOperationExecutor
stackTrace
- a stack traceErrorException
- the error exceptionprotected Namespace createChildNamespaceInternal(String name, List<? extends Field> fields, List<?> values, Map<FreeType,Type> freeTypeMapping, InterpreterConfiguration configuration)
name
- fields
- values
- freeTypeMapping
- configuration
- public AbstractContextNamespace getNamespaceInLevel(String level)
Namespace
getNamespaceInLevel
in interface Namespace
protected AbstractContextNamespace getNamespace(Context ctx)
ctx
- public ExecutionContext getExecutionContext()
getExecutionContext
in interface Namespace
public RecordHolder getThis()
Namespace
public ListHolder createRange(long first, long last)
HolderFactory
If first <= last
, the range contains elements first, first + 1, ..., last
.
If first > last
, the range contains elements first, first - 1, ..., last
.
The memory footprint of range in constant (only endpoints and size is stored, not all elements).
createRange
in interface HolderFactory
protected Context getReferencedContext(ContextReferencingExpression expression)
protected Context getFunctionContext(FunctionExpression expression)
public void remove()
Namespace
public Collection<String> getModuleNames()
Namespace
getModuleNames
in interface Namespace
public CompiledNamespace getCompiled()
getCompiled
in interface Namespace
public Object getCompiled(String moduleName)
getCompiled
in interface Namespace
public void setCompiled(Object compiledContext)
setCompiled
in interface Namespace
public CompiledContext getCompiledContext(Namespace moduleNamespace, String evaluationLevel)
public Set<String> getAllFreeTypeNames()
Namespace
getAllFreeTypeNames
in interface Namespace
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.