public class ContextNamespace extends AbstractContextNamespace
Modifier | Constructor and Description |
---|---|
protected |
ContextNamespace(ModelProviderClientService modelProviderService,
Context context)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addNewVariable(String name,
Type type,
boolean isExpressionLocal)
Adds a new variable.
|
boolean |
canBeInterpretedIn(InterpreterConfiguration configuration)
in detached model instance interpretation can be done only in new evaluation levels
|
boolean |
containsVariable(String name)
Returns
true if this namespace contains variable of given name. |
static AbstractContextNamespace |
create(ModelProviderClientService modelProviderService,
Context context)
Creates a new namespace according to the evaluation level
of the provided context.
|
BinaryHolder |
createBinaryHolder(byte[] data)
Creates binary data holder.
|
BinaryHolder |
createBinaryHolder(String datasourceJndi,
String recordType,
String objectIdentification,
String propertyName,
Blob data)
Creates binary data holder.
|
Namespace |
createChildNamespace(String name,
Collection<Field> fields,
Collection<?> values,
InterpreterConfiguration configuration)
Creates new child namespace with this namespace as the parent.
|
ClosureHolder |
createClosure(ClosureType closureType,
ClosureExpression closureExpression,
ClosureOrigin origin)
Creates new closure corresponding to given closure expression.
|
ClosureHolder |
createClosure(ClosureType closureType,
FunctionExpression operationExpression,
ClosureOrigin origin)
Creates new closure corresponding to given operation expression.
|
ClosureHolder |
createClosure(ClosureType closureType,
MethodExpression operationExpression,
ClosureOrigin origin)
Creates new closure corresponding to given operation expression.
|
ClosureHolder |
createClosureFromExpression(ClosureType closureType,
Expression expression,
ClosureOrigin origin)
Creates new closure from a given expression.
|
RecordHolder |
createExternalRecordProxy(RecordType type)
Creates a proxy without proxied record.
|
ListHolder |
createList(Collection<?> values)
Creates new list with given values (
ListHolder s are immutable). |
MapHolder |
createMap(Map<?,?> values)
Creates new map with given values (
MapHolder s are immutable). |
RecordHolder |
createNonSharedRecord(RecordType type,
Map<String,?> values)
Creates new record of given type.
|
RecordHolder |
createRecord(RecordType type)
Creates new record with given type.
|
RecordHolder |
createRecord(RecordType type,
Map<String,?> values)
Creates new record with given type.
|
RecordHolder |
createRecord(String type)
Creates new record with given type.
|
RecordHolder |
createRecord(String type,
Map<String,?> values)
Creates new record with given type.
|
ReferenceHolder |
createReference(ReferenceType referenceType,
ReferenceExpression referenceExpression,
List<Property> properties,
ClosureOrigin origin)
Returns new reference corresponding to given reference expression.
|
SetHolder |
createSet(Collection<?> values)
Creates new set with given values (
SetHolder s are immutable). |
InterpreterConfiguration |
getConfiguration()
Returns interpreter configurartion for this namespace.
|
Type |
getFreeType(FreeType type)
Returns the value of given free type or null if it does not exist in this context.
|
HolderFactory |
getHolderFactory()
Returns an instance of
HolderFactory . |
Object |
getJavaObject()
Returns underlying java object if there is some.
|
Namespace |
getLowerLevelNamespace()
Returns namespace corresponding to this namespace on lower level.
|
Collection<String> |
getModuleNames()
Returns collection of all module names.
|
Namespace |
getModuleNamespace(String name)
Returns module namespace by its module name or
null if it does not exist. |
Namespace |
getParentNamespace()
Returns parent namespace or
null if this is top namespace. |
Set<String> |
getVariableNames()
Returns the names of all the variables.
|
Type |
getVariableType(String name)
Returns the type of variable or null if it does not exist.
|
Object |
getVariableValue(String name)
Returns value of variable for given name from this namespace.
|
void |
setFreeType(FreeType type,
Type value)
Sets value for given free type.
|
void |
setPerformReadOnlyCheck(boolean isPerformingCheck)
Allows to enable/disable checking assignment to read only variables.
|
void |
setVariableValue(String name,
Object value)
Sets value of variable for given name from this namespace.
|
checkCanAssignToVariable, createChildNamespaceInternal, createRange, executeJavaOperation, getConstantValue, getContext, getContextId, getConverter, getEvaluationConverter, getEvaluationLevel, getExecutionContext, getFunctionContextId, getModelElementId, getModelId, getModelInstanceId, getModelProviderService, getName, getNamespace, getNamespaceInLevel, getNamespaceModel, getPathQID, getProcessModel, getReferencedContextId, getThis, remove, resolveRecordType, resolveType, toString
protected ContextNamespace(ModelProviderClientService modelProviderService, Context context)
modelProviderService
- context
- public static AbstractContextNamespace create(ModelProviderClientService modelProviderService, Context context)
modelProviderService
- context
- public InterpreterConfiguration getConfiguration()
Namespace
public boolean containsVariable(String name)
Namespace
true
if this namespace contains variable of given name.name
- variable namepublic Collection<String> getModuleNames()
Namespace
public Namespace getModuleNamespace(String name)
Namespace
null
if it does not exist.public Namespace getParentNamespace()
Namespace
null
if this is top namespace.public Type getVariableType(String name)
Namespace
name
- variable namepublic Set<String> getVariableNames()
Namespace
public Object getVariableValue(String name)
Namespace
Null
is returned
if this namespace does not contain given variable.name
- variable namepublic void setVariableValue(String name, Object value)
Namespace
name
- variable namevalue
- new variable valuepublic Namespace createChildNamespace(String name, Collection<Field> fields, Collection<?> values, InterpreterConfiguration configuration)
Namespace
fields
.name
- the namespace namepublic void addNewVariable(String name, Type type, boolean isExpressionLocal)
Namespace
public Type getFreeType(FreeType type)
Namespace
public void setFreeType(FreeType type, Type value)
Namespace
public HolderFactory getHolderFactory()
Namespace
HolderFactory
. This can be used to create different runtime
objects.HolderFactory
public ListHolder createList(Collection<?> values)
HolderFactory
ListHolder
s are immutable).
The type is inferred from the types of the values.public SetHolder createSet(Collection<?> values)
HolderFactory
SetHolder
s are immutable). The
type is inferred from the types of the values.public MapHolder createMap(Map<?,?> values)
HolderFactory
MapHolder
s are immutable). The
type is inferred from the types of the values.public RecordHolder createRecord(RecordType type)
HolderFactory
public RecordHolder createExternalRecordProxy(RecordType type)
HolderFactory
public RecordHolder createRecord(RecordType type, Map<String,?> values)
HolderFactory
values
- initial record field valuespublic RecordHolder createNonSharedRecord(RecordType type, Map<String,?> values)
HolderFactory
values
- initial record field valuespublic RecordHolder createRecord(String type)
HolderFactory
RecordType
public RecordHolder createRecord(String type, Map<String,?> values)
HolderFactory
values
- initial record field valuesRecordType
public BinaryHolder createBinaryHolder(byte[] data)
HolderFactory
public BinaryHolder createBinaryHolder(String datasourceJndi, String recordType, String objectIdentification, String propertyName, Blob data)
HolderFactory
public boolean canBeInterpretedIn(InterpreterConfiguration configuration)
public void setPerformReadOnlyCheck(boolean isPerformingCheck)
Namespace
public Namespace getLowerLevelNamespace()
Namespace
public Object getJavaObject()
Namespace
public ClosureHolder createClosure(ClosureType closureType, ClosureExpression closureExpression, ClosureOrigin origin)
HolderFactory
public ClosureHolder createClosureFromExpression(ClosureType closureType, Expression expression, ClosureOrigin origin)
HolderFactory
public ClosureHolder createClosure(ClosureType closureType, FunctionExpression operationExpression, ClosureOrigin origin)
HolderFactory
public ClosureHolder createClosure(ClosureType closureType, MethodExpression operationExpression, ClosureOrigin origin)
HolderFactory
public ReferenceHolder createReference(ReferenceType referenceType, ReferenceExpression referenceExpression, List<Property> properties, ClosureOrigin origin)
HolderFactory
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.