public interface EvaluationEnvironment extends DomainEvaluationEnvironment, BasicEnvironment
See the Environment class for a description of the
generic type parameters of this class.
As of the 1.2 release, evaluation environments are encouraged to implement
the Adaptable interface to provide optional interfaces such as
Customizable for specifying evaluation options. Moreover, the
(AbstractEvaluationEnvironment) class implements the Adaptable
protocol. Use the OCLUtil.getAdapter(EvaluationEnvironment, Class)
method to obtain adapters for any evaluation environment instance.
| Modifier and Type | Method and Description |
|---|---|
void |
add(DomainTypedElement referredVariable,
java.lang.Object value)
Adds the supplied variable declaration and value binding to the environment.
|
void |
clear()
Clears the environment of variables.
|
DomainModelManager |
createModelManager(java.lang.Object object)
Creates an extent map for invocation of OclType.allInstances()
using the specified
object as a context from which to find
the scope in which OCL classifier extents are defined. |
MetaModelManager |
getMetaModelManager()
Obtains the Java-language value of the specified enumeration literal.
|
Type |
getType(java.lang.Object object)
Deprecated.
|
java.lang.Object |
getValueOf(VariableDeclaration referredVariable)
Returns the value associated with the supplied variable declaration
|
java.lang.Object |
navigateAssociationClass(Type associationClass,
Property navigationSource,
java.lang.Object source)
Obtains the instance of the specified association class that links the
specified source element, optionally via the specified property.
|
boolean |
overrides(Operation operation,
int opcode)
Queries whether this evaluation environment provides a custom
implementation of the specified pre-defined OCL
operation. |
java.lang.Object |
remove(DomainTypedElement referredVariable)
Deprecated.
let expiry of a nested evaluation environment remove automatically
|
void |
replace(DomainTypedElement referredVariable,
java.lang.Object value)
Replaces the current value of the supplied variable declaration with the supplied value.
|
createVariablegetAdapterclearOptions, getOptions, getValue, isEnabled, putOptions, removeOption, removeOptions, setOptionjava.lang.Object getValueOf(@NonNull
VariableDeclaration referredVariable)
referredVariable - the name whose value is to be returnedvoid replace(@NonNull
DomainTypedElement referredVariable,
java.lang.Object value)
replace in interface DomainEvaluationEnvironmentreferredVariable - the variable declarationvalue - the new valuevoid add(@NonNull
DomainTypedElement referredVariable,
java.lang.Object value)
add in interface DomainEvaluationEnvironmentreferredVariable - the variable declaration to addvalue - the associated binding#replace(String, Object)@Deprecated
java.lang.Object remove(@NonNull
DomainTypedElement referredVariable)
referredVariable - the variable declaration to removevoid clear()
boolean overrides(@NonNull
Operation operation,
int opcode)
operation.
In the case that the receiver does, then it must implement the
#callOperation method to apply the operation.operation - an OCL operationopcode - the operation code, if one of the operations pre-defined
by OCL. Otherwise, -1true if this evaluation environment provides an
implementation of this operation; false,
otherwise#callOperationjava.lang.Object navigateAssociationClass(Type associationClass, Property navigationSource, java.lang.Object source) throws java.lang.IllegalArgumentException
associationClass - the association class to navigate tonavigationSource - in case of ambiguity, the property of the
source element's classifier through which to navigate to the
association classsource - the source element from which to navigatejava.lang.IllegalArgumentException - if the association class is not
associated with the source element, or is not supported by this
environment@NonNull DomainModelManager createModelManager(@Nullable java.lang.Object object)
object as a context from which to find
the scope in which OCL classifier extents are defined. This scope may
be a resource, resource set, or some metamodel-specific scope. Note that
in the case that the object is not an
EObject but is, instead, some primitive
type, then this may be difficult to determine.
Clients are encouraged to do what they can to optimize this mapping, by
lazy initialization of key-value pairs, workspace indices, or whatever
means is available. Note that the map will only ever be accessed by
key (Map.get(java.lang.Object)); it will never be queried for
all entries, all keys, all values, etc. This knowledge could help
optimization.
object - a context object in the scope that covers the OCL
classifier extents@Deprecated Type getType(java.lang.Object object)
object - an object@NonNull MetaModelManager getMetaModelManager()
enumerationLiteral - the enumeration literal model element