|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ocl.examples.pivot.AbstractBasicEnvironment<EvaluationEnvironment> org.eclipse.ocl.examples.pivot.evaluation.AbstractEvaluationEnvironment org.eclipse.ocl.examples.pivot.evaluation.PivotEvaluationEnvironment
public class PivotEvaluationEnvironment
Implementation of the EvaluationEnvironment
for evaluation of OCL
expressions on instances of Ecore models (i.e., on M0 models).
Field Summary |
---|
Fields inherited from class org.eclipse.ocl.examples.pivot.evaluation.AbstractEvaluationEnvironment |
---|
metaModelManager |
Fields inherited from class org.eclipse.ocl.examples.pivot.AbstractBasicEnvironment |
---|
parent |
Constructor Summary | |
---|---|
PivotEvaluationEnvironment(EvaluationEnvironment parent)
Initializes me with my parent evaluation environment (nesting scope). |
|
PivotEvaluationEnvironment(MetaModelManager metaModelManager)
Initializes me. |
Method Summary | |
---|---|
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. |
DomainTypedElement |
createVariable(java.lang.String name,
DomainType type)
Ecore implementation of the enumeration literal value. |
Type |
getType(java.lang.Object object)
Queries the type of the specified object. |
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. |
Methods inherited from class org.eclipse.ocl.examples.pivot.evaluation.AbstractEvaluationEnvironment |
---|
add, clear, getMetaModelManager, getValueOf, getVariables, overrides, remove, replace, toString |
Methods inherited from class org.eclipse.ocl.examples.pivot.AbstractBasicEnvironment |
---|
basicGetOptions, clearOptions, getAdapter, getOptions, getParent, getValue, isEnabled, notOK, putOptions, removeOption, removeOptions, setOption, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.ocl.examples.pivot.Adaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.ocl.examples.pivot.Customizable |
---|
clearOptions, getOptions, getValue, isEnabled, putOptions, removeOption, removeOptions, setOption |
Constructor Detail |
---|
public PivotEvaluationEnvironment(@NonNull MetaModelManager metaModelManager)
public PivotEvaluationEnvironment(@NonNull EvaluationEnvironment parent)
parent
- my parent (nesting scope); must not be null
Method Detail |
---|
@NonNull public 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
@NonNull public DomainTypedElement createVariable(@NonNull java.lang.String name, @NonNull DomainType type)
public java.lang.Object navigateAssociationClass(Type associationClass, Property navigationSource, java.lang.Object source) throws java.lang.IllegalArgumentException
EvaluationEnvironment
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 navigate
java.lang.IllegalArgumentException
- if the association class is not
associated with the source element, or is not supported by this
environmentpublic Type getType(java.lang.Object object)
EvaluationEnvironment
object
- an object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |