public class RecordNamespace extends AbstractContextNamespace
Constructor and Description |
---|
RecordNamespace(ModelProvider modelProvider,
Namespace namespace,
RecordHolder recordHolder)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addNewVariable(String name,
Type type,
boolean isDefinedInExpression,
boolean readOnly)
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,
List<? extends Field> fields,
List<?> initialValues,
Map<FreeType,Type> freeTypeMapping,
InterpreterConfiguration configuration) |
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,
RecordHolder proxySet)
Creates a proxy without proxied record.
|
ListHolder |
createList(Collection<?> values)
Creates new list with given values (
ListHolder s are immutable). |
MapHolder |
createMap(List<?> keys,
List<?> values)
Creates new map with given values (
MapHolder 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,
Map<String,?> values)
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.
|
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 |
initializeVariable(String name,
Object value)
Sets the initial value of a variable.
|
boolean |
isVariableReadOnly(String name)
Returns
true if the variable with a given name is read-only. |
void |
setAsType(RecordType type)
If set the namespace behaves like if it is namespace for the type.
|
void |
setVariableValue(String name,
Object value)
Sets value of variable for given name from this namespace.
|
createChildNamespaceInternal, createRange, executeJavaOperation, getAllFreeTypeNames, getCompiled, getCompiled, getCompiledContext, getConstantValue, getContext, getContextId, getConverter, getEvaluationConverter, getEvaluationLevel, getExecutionContext, getFunctionContext, getModelId, getModelInstanceId, getModelProvider, getNamespace, getProcessModel, getReferencedContext, remove, resolveType, setCompiled, setVariableValueInternal, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addNewVariable, createChildNamespace, getFreeTypeMapping, getTopNamespace, resolveRecordType
createRecord, createRecord
public RecordNamespace(ModelProvider modelProvider, Namespace namespace, RecordHolder recordHolder)
modelProvider
- namespace
- recordHolder
- public void setAsType(RecordType type)
type
- public RecordHolder createExternalRecordProxy(RecordType type, RecordHolder proxySet)
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, Map<String,?> values)
HolderFactory
values
- initial record field valuesRecordType
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(List<?> keys, List<?> values)
HolderFactory
MapHolder
s are immutable). The
type is inferred from the types of the values.keys
- a list of keysvalues
- a list of valuespublic MapHolder createMap(Map<?,?> values)
HolderFactory
MapHolder
s are immutable). The
type is inferred from the types of the values.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
public BinaryHolder createBinaryHolder(byte[] data)
HolderFactory
public BinaryHolder createBinaryHolder(String datasourceJndi, String recordType, String primaryKeyString, String propertyName, Blob data)
HolderFactory
public String getName()
Namespace
null
and does not have to be
unique. Multiple namespaces can share same name.getName
in interface Namespace
getName
in class AbstractContextNamespace
public Namespace getParentNamespace()
Namespace
null
if this is top namespace.public Namespace getModuleNamespace(String name)
Namespace
null
if it does not exist.public Collection<String> getModuleNames()
Namespace
getModuleNames
in interface Namespace
getModuleNames
in class AbstractContextNamespace
public boolean containsVariable(String name)
Namespace
true
if this namespace contains variable of given name.name
- variable namepublic Set<String> getVariableNames()
Namespace
public Object getVariableValue(String name)
Namespace
Null
is returned
if this namespace does not contain given variable.getVariableValue
in interface Namespace
getVariableValue
in class AbstractContextNamespace
name
- variable namepublic void setVariableValue(String name, Object value)
Namespace
name
- variable namevalue
- new variable valuepublic void initializeVariable(String name, Object value)
Namespace
public Type getVariableType(String name)
Namespace
name
- variable namepublic boolean isVariableReadOnly(String name)
Namespace
true
if the variable with a given name is read-only.true
if the variable is read-onlypublic HolderFactory getHolderFactory()
Namespace
HolderFactory
. This can be used to create different runtime
objects.HolderFactory
public Namespace createChildNamespace(String name, List<? extends Field> fields, List<?> initialValues, Map<FreeType,Type> freeTypeMapping, InterpreterConfiguration configuration)
public Type getFreeType(FreeType type)
Namespace
getFreeType
in interface Namespace
getFreeType
in class AbstractContextNamespace
public void addNewVariable(String name, Type type, boolean isDefinedInExpression, boolean readOnly)
Namespace
public InterpreterConfiguration getConfiguration()
Namespace
public boolean canBeInterpretedIn(InterpreterConfiguration configuration)
Namespace
public AbstractContextNamespace getNamespaceInLevel(String evaluationLevel)
Namespace
getNamespaceInLevel
in interface Namespace
getNamespaceInLevel
in class AbstractContextNamespace
public Namespace getLowerLevelNamespace()
Namespace
public NamespaceModel getNamespaceModel()
Namespace
NamespaceModel
for this namespace.getNamespaceModel
in interface Namespace
getNamespaceModel
in class AbstractContextNamespace
NamespaceModel
for this namespacepublic String getModelElementId()
Namespace
getModelElementId
in interface Namespace
getModelElementId
in class AbstractContextNamespace
public QID getPathQID()
Namespace
QID
of the context path.getPathQID
in interface Namespace
getPathQID
in class AbstractContextNamespace
QID
of the context pathpublic RecordHolder getThis()
Namespace
getThis
in interface Namespace
getThis
in class AbstractContextNamespace
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.