public class BasicEvaluationEnvironment extends AbstractCustomizable implements EvaluationEnvironment.EvaluationEnvironmentExtension
EvaluationEnvironment
interface,
providing some useful common behaviors. Implementors of metamodel-specific
environments are encourage to extend this class rather than implement
an evaluation environment "from scratch."EvaluationEnvironment.EvaluationEnvironmentExtension
Modifier and Type | Field and Description |
---|---|
protected OCLExpression |
callingObject |
protected EnvironmentFactory |
environmentFactory |
protected NamedElement |
executableObject |
protected ExecutorInternal |
executor |
protected ModelManager |
modelManager
Deprecated.
use an executor
|
protected EvaluationEnvironment |
parent |
Constructor and Description |
---|
BasicEvaluationEnvironment(EnvironmentFactory environmentFactory,
NamedElement executableObject,
ModelManager modelManager)
Deprecated.
use an executor
|
BasicEvaluationEnvironment(EvaluationEnvironment.EvaluationEnvironmentExtension parent,
NamedElement executableObject,
OCLExpression callingObject) |
BasicEvaluationEnvironment(EvaluationEnvironment parent,
NamedElement executableObject)
Deprecated.
supply a callingObject
|
BasicEvaluationEnvironment(ExecutorInternal executor,
NamedElement executableObject) |
Modifier and Type | Method and Description |
---|---|
void |
add(TypedElement referredVariable,
java.lang.Object value)
Adds the supplied referredVariable and value binding to the environment
|
void |
clear()
Clears the environment of variables.
|
void |
dispose()
Dispose of any owned objects.
|
<T> T |
getAdapter(java.lang.Class<T> adapterType)
Implements the interface method by testing whether I am an instance of
the requested adapter type.
|
EnvironmentFactory |
getEnvironmentFactory() |
NamedElement |
getExecutableObject() |
ExecutorInternal |
getExecutor() |
ModelManager |
getModelManager()
Deprecated.
moved to Evaluator
|
EvaluationEnvironment |
getParent() |
EvaluationEnvironment.EvaluationEnvironmentExtension |
getParentEvaluationEnvironment() |
<T> T |
getValue(Option<T> option)
Obtains the value of the specified option's setting in the my
options map.
|
java.lang.Object |
getValueOf(TypedElement referredVariable)
Returns the value associated with the supplied referredVariable
|
java.util.Set<TypedElement> |
getVariables()
Return the set of all locally registered variables.
|
java.lang.Object |
remove(TypedElement referredVariable)
Removes the supplied referredVariable and binding from the environment (if it exists)
and returns it.
|
void |
replace(TypedElement referredVariable,
java.lang.Object value)
Replaces the current value of the supplied referredVariable with the supplied value.
|
java.lang.String |
toString()
Returns a string representation of the bindings
|
basicGetOptions, clearOptions, getOptions, isEnabled, putOptions, removeOption, removeOptions, setOption
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearOptions, getOptions, isEnabled, putOptions, removeOption, removeOptions, setOption
@NonNull protected final ExecutorInternal executor
@NonNull protected final EnvironmentFactory environmentFactory
@Nullable protected final EvaluationEnvironment parent
@NonNull protected final NamedElement executableObject
@Nullable protected final OCLExpression callingObject
@Deprecated @NonNull protected final ModelManager modelManager
@Deprecated public BasicEvaluationEnvironment(@NonNull EnvironmentFactory environmentFactory, @NonNull NamedElement executableObject, @NonNull ModelManager modelManager)
public BasicEvaluationEnvironment(@NonNull ExecutorInternal executor, @NonNull NamedElement executableObject)
@Deprecated public BasicEvaluationEnvironment(@NonNull EvaluationEnvironment parent, @NonNull NamedElement executableObject)
public BasicEvaluationEnvironment(EvaluationEnvironment.EvaluationEnvironmentExtension parent, @NonNull NamedElement executableObject, @Nullable OCLExpression callingObject)
public void add(@NonNull TypedElement referredVariable, @Nullable java.lang.Object value)
add
in interface EvaluationEnvironment
referredVariable
- the referredVariable to addvalue
- the associated bindingEvaluationEnvironment.replace(TypedElement, Object)
public void clear()
clear
in interface EvaluationEnvironment
public void dispose()
dispose
in interface EvaluationEnvironment
@Nullable public <T> T getAdapter(java.lang.Class<T> adapterType)
getAdapter
in interface Adaptable
getAdapter
in class AbstractCustomizable
T
- the requested adapter interfaceadapterType
- the requested adapter interfacenull
if this environment does not adapt to it@NonNull public EnvironmentFactory getEnvironmentFactory()
getEnvironmentFactory
in interface EvaluationEnvironment
@NonNull public NamedElement getExecutableObject()
getExecutableObject
in interface EvaluationEnvironment
@NonNull public ExecutorInternal getExecutor()
getExecutor
in interface EvaluationEnvironment.EvaluationEnvironmentExtension
@Deprecated @NonNull public ModelManager getModelManager()
getModelManager
in interface EvaluationEnvironment
@Nullable public EvaluationEnvironment getParent()
getParent
in class AbstractCustomizable
public EvaluationEnvironment.EvaluationEnvironmentExtension getParentEvaluationEnvironment()
getParentEvaluationEnvironment
in interface EvaluationEnvironment.EvaluationEnvironmentExtension
public <T> T getValue(@NonNull Option<T> option)
Customizable
getValue
in interface Customizable
getValue
in class AbstractCustomizable
option
- the option to query@Nullable public java.lang.Object getValueOf(@NonNull TypedElement referredVariable)
getValueOf
in interface EvaluationEnvironment
referredVariable
- the referredVariable whose value is to be returned@NonNull public java.util.Set<TypedElement> getVariables()
EvaluationEnvironment
getVariables
in interface EvaluationEnvironment
@Nullable public java.lang.Object remove(@NonNull TypedElement referredVariable)
remove
in interface EvaluationEnvironment
referredVariable
- the referredVariable to removepublic void replace(@NonNull TypedElement referredVariable, @Nullable java.lang.Object value)
replace
in interface EvaluationEnvironment
referredVariable
- the referredVariablevalue
- the new valuepublic java.lang.String toString()
toString
in class java.lang.Object