public abstract class AbstractContextNamespace extends Object implements Namespace, JavaOperationExecutor
Constructor and Description |
---|
AbstractContextNamespace(ModelProviderClientService modelProviderService,
Context context)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkCanAssignToVariable(Context context,
String name)
Check if it is possible to assign a value to variable.
|
protected Namespace |
createChildNamespaceInternal(String name,
Collection<Field> fields,
Collection<?> values,
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,
List<Object> evaluatedArgs,
InterpreterStackTrace stackTrace)
Executes the operation.
|
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() |
protected long |
getFunctionContextId(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.
|
ModelProviderClientService |
getModelProviderService()
Returns the provided model provider service.
|
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 long |
getReferencedContextId(ContextReferencingExpression expression) |
RecordHolder |
getThis()
Returns object that represents this.
|
void |
remove()
INTERNAL API.
|
RecordType |
resolveRecordType(String type)
Resolves record type and returns its type.
|
Type |
resolveType(String type)
Resolves type.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addNewVariable, canBeInterpretedIn, containsVariable, createChildNamespace, getConfiguration, getFreeType, getHolderFactory, getJavaObject, getLowerLevelNamespace, getModuleNames, getModuleNamespace, getParentNamespace, getVariableNames, getVariableType, getVariableValue, setFreeType, setPerformReadOnlyCheck, setVariableValue
createBinaryHolder, createBinaryHolder, createClosure, createClosure, createClosure, createClosureFromExpression, createExternalRecordProxy, createList, createMap, createNonSharedRecord, createRecord, createRecord, createRecord, createRecord, createReference, createSet
public AbstractContextNamespace(ModelProviderClientService modelProviderService, Context context)
modelProviderService
- context
- public ModelProviderClientService getModelProviderService()
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 RecordType resolveRecordType(String type)
Namespace
NamespaceModel.findNamedType(QID)
as follows:
final boolean recordExists = getNamespaceModel().findNamedType(QID.parse(type)) != null;
resolveRecordType
in interface Namespace
type
- fully qualified record type, not null.public Type resolveType(String type)
Namespace
resolveType
in interface Namespace
protected void checkCanAssignToVariable(Context context, String name)
context
- name
- public String getEvaluationLevel()
getEvaluationLevel
in interface Namespace
public 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, List<Object> evaluatedArgs, InterpreterStackTrace stackTrace) throws ErrorException
JavaOperationExecutor
executeJavaOperation
in interface JavaOperationExecutor
stackTrace
- a stack traceErrorException
- the error exceptionprotected Namespace createChildNamespaceInternal(String name, Collection<Field> fields, Collection<?> values, InterpreterConfiguration configuration)
name
- fields
- values
- 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 long getReferencedContextId(ContextReferencingExpression expression)
protected long getFunctionContextId(FunctionExpression expression)
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.