public class RecordNamespace extends AbstractContextNamespace
| Constructor and Description |
|---|
RecordNamespace(ModelProviderClientService modelProviderService,
Namespace namespace,
RecordHolder recordHolder)
Creates new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNewVariable(String name,
Type type,
boolean isDefinedInExpression)
Adds a new variable.
|
boolean |
canBeInterpretedIn(InterpreterConfiguration configuration)
Returns true if interpretation with given configuration can be done on this namespace.
|
boolean |
containsVariable(String name)
Returns
true if this namespace contains variable of given name. |
BinaryHolder |
createBinaryHolder(byte[] data)
Creates binary data holder.
|
BinaryHolder |
createBinaryHolder(String datasourceJndi,
String recordType,
String primaryKeyString,
String propertyName,
Blob data)
Creates binary data holder.
|
Namespace |
createChildNamespace(String name,
Collection<Field> fields,
Collection<?> initialValues,
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 (
ListHolders are immutable). |
MapHolder |
createMap(Map<?,?> values)
Creates new map with given values (
MapHolders 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 (
SetHolders are immutable). |
InterpreterConfiguration |
getConfiguration()
Returns interpreter configurartion for this namespace.
|
ExecutionContext |
getExecutionContext() |
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.
|
String |
getModelElementId()
Returns id of model element that is related to this namespace.
|
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. |
String |
getName()
Returns name of this namespace.
|
AbstractContextNamespace |
getNamespaceInLevel(String evaluationLevel)
Returns namespace in evaluation level.
|
NamespaceModel |
getNamespaceModel()
Returns
NamespaceModel for this namespace. |
Namespace |
getParentNamespace()
Returns parent namespace or
null if this is top namespace. |
QID |
getPathQID()
Returns
QID of the context path. |
RecordHolder |
getThis()
Returns object that represents this.
|
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 |
setAsType(RecordType type)
If set the namespace behaves like if it is namespace for the type.
|
void |
setFreeType(FreeType type,
Type value)
Sets value for given free type.
|
void |
setPerformReadOnlyCheck(boolean performReadOnlyCheck)
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, getFunctionContextId, getModelId, getModelInstanceId, getModelProviderService, getNamespace, getProcessModel, getReferencedContextId, remove, resolveRecordType, resolveType, toStringpublic RecordNamespace(ModelProviderClientService modelProviderService, Namespace namespace, RecordHolder recordHolder)
modelProviderService - namespace - recordHolder - public void setAsType(RecordType type)
type - public RecordHolder createRecord(RecordType type)
HolderFactorypublic RecordHolder createExternalRecordProxy(RecordType type)
HolderFactorypublic RecordHolder createRecord(RecordType type, Map<String,?> values)
HolderFactoryvalues - initial record field valuespublic RecordHolder createNonSharedRecord(RecordType type, Map<String,?> values)
HolderFactoryvalues - initial record field valuespublic RecordHolder createRecord(String type)
HolderFactoryRecordTypepublic RecordHolder createRecord(String type, Map<String,?> values)
HolderFactoryvalues - initial record field valuesRecordTypepublic ListHolder createList(Collection<?> values)
HolderFactoryListHolders are immutable).
The type is inferred from the types of the values.public SetHolder createSet(Collection<?> values)
HolderFactorySetHolders are immutable). The
type is inferred from the types of the values.public MapHolder createMap(Map<?,?> values)
HolderFactoryMapHolders are immutable). The
type is inferred from the types of the values.public ClosureHolder createClosure(ClosureType closureType, ClosureExpression closureExpression, ClosureOrigin origin)
HolderFactorypublic ClosureHolder createClosureFromExpression(ClosureType closureType, Expression expression, ClosureOrigin origin)
HolderFactorypublic ClosureHolder createClosure(ClosureType closureType, FunctionExpression operationExpression, ClosureOrigin origin)
HolderFactorypublic ClosureHolder createClosure(ClosureType closureType, MethodExpression operationExpression, ClosureOrigin origin)
HolderFactorypublic ReferenceHolder createReference(ReferenceType referenceType, ReferenceExpression referenceExpression, List<Property> properties, ClosureOrigin origin)
HolderFactorypublic BinaryHolder createBinaryHolder(byte[] data)
HolderFactorypublic BinaryHolder createBinaryHolder(String datasourceJndi, String recordType, String primaryKeyString, String propertyName, Blob data)
HolderFactorypublic String getName()
Namespacenull and does not have to be
unique. Multiple namespaces can share same name.getName in interface NamespacegetName in class AbstractContextNamespacepublic Namespace getParentNamespace()
Namespacenull if this is top namespace.public Namespace getModuleNamespace(String name)
Namespacenull if it does not exist.public Collection<String> getModuleNames()
Namespacepublic boolean containsVariable(String name)
Namespacetrue if this namespace contains variable of given name.name - variable namepublic Set<String> getVariableNames()
Namespacepublic Object getVariableValue(String name)
NamespaceNull is returned
if this namespace does not contain given variable.name - variable namepublic void setVariableValue(String name, Object value)
Namespacename - variable namevalue - new variable valuepublic Type getVariableType(String name)
Namespacename - variable namepublic HolderFactory getHolderFactory()
NamespaceHolderFactory. This can be used to create different runtime
objects.HolderFactorypublic Namespace createChildNamespace(String name, Collection<Field> fields, Collection<?> initialValues, InterpreterConfiguration configuration)
Namespacefields.name - the namespace namepublic void setFreeType(FreeType type, Type value)
Namespacepublic Type getFreeType(FreeType type)
Namespacepublic void addNewVariable(String name, Type type, boolean isDefinedInExpression)
Namespacepublic InterpreterConfiguration getConfiguration()
Namespacepublic boolean canBeInterpretedIn(InterpreterConfiguration configuration)
Namespacepublic void setPerformReadOnlyCheck(boolean performReadOnlyCheck)
Namespacepublic AbstractContextNamespace getNamespaceInLevel(String evaluationLevel)
NamespacegetNamespaceInLevel in interface NamespacegetNamespaceInLevel in class AbstractContextNamespacepublic Namespace getLowerLevelNamespace()
Namespacepublic NamespaceModel getNamespaceModel()
NamespaceNamespaceModel for this namespace.getNamespaceModel in interface NamespacegetNamespaceModel in class AbstractContextNamespaceNamespaceModel for this namespacepublic String getModelElementId()
NamespacegetModelElementId in interface NamespacegetModelElementId in class AbstractContextNamespacepublic QID getPathQID()
NamespaceQID of the context path.getPathQID in interface NamespacegetPathQID in class AbstractContextNamespaceQID of the context pathpublic RecordHolder getThis()
NamespacegetThis in interface NamespacegetThis in class AbstractContextNamespacepublic Object getJavaObject()
Namespacepublic ExecutionContext getExecutionContext()
getExecutionContext in interface NamespacegetExecutionContext in class AbstractContextNamespaceCopyright © 2007-2018 Whitestein Technologies. All Rights Reserved.