|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PK
- is substituted by the metaclass representing the metamodel's
analogue for the UML 2.x PackageC
- corresponds to the UML Classifier metaclassO
- corresponds to the UML Operation metaclassP
- corresponds to the UML Property metaclassEL
- corresponds to the UML EnumerationLiteral metaclass
(Enumerations are simply represented as classifiers)PM
- corresponds to the UML Parameter metaclassS
- corresponds to the UML State metaclass (for metamodels
that describe state machines)COA
- corresponds to the UML CallOperationAction metaclass
(used in message expressions)SSA
- corresponds to the UML SendSignalAction metaclass
(used in message expressions)CT
- corresponds to the UML Constraint metaclassCLS
- corresponds to the UML Class metaclassE
- corresponds to the UML Element metaclasspublic interface EnvironmentFactory
A factory for creating OCL parser Environment
s. Clients of the OCL
parser that wish to use OCL with their metamodels can provide the parser
a factory that creates the suitable environments. The environment provides
mappings from the client's metamodel to the UML concepts required by the
parser (corresponding to the generic type parameters, below). Many of these
mappings are optional (e.g., state machines, signals, and association
classes aren't supported by all metamodels).
This interface is not intended to be implemented to be implemented
"directly" by providers of metamodel bindings.
It is highly recommended to extend the AbstractEnvironmentFactory
class, instead.
Since 1.2, the AbstractEnvironmentFactory
implements the
Adaptable
interface and provides an adapter for the
EnvironmentFactory.Lookup
interface. Use the
OCLUtil.getAdapter(EnvironmentFactory, Class)
method to obtain
adapters for any factory instance.
Method Summary | |
---|---|
Environment |
createClassifierContext(Environment parent,
Type context)
Creates an environment suitable for parsing OCL expressions in the specified context , which is some classifier
in the client's model. |
Environment |
createEnvironment()
Creates a root environment, in which package contexts and/or classifier contexts will be created as nested environments. |
Environment |
createEnvironment(Environment parent)
Creates a child environment of a specified parent , for
definition of nested scopes. |
EvaluationEnvironment |
createEvaluationEnvironment()
Creates a new evaluation environment to track the values of variables in an OCL expression as it is evaluated. |
EvaluationEnvironment |
createEvaluationEnvironment(EvaluationEnvironment parent)
Creates a new evaluation environment as a nested environment of the specified parent. |
EvaluationVisitor |
createEvaluationVisitor(Environment env,
EvaluationEnvironment evalEnv,
DomainModelManager modelManager)
Creates a new evaluation visitor, for the evaluation of OCL expressions. |
Environment |
createInstanceContext(Environment parent,
java.lang.Object context)
Creates an environment suitable for parsing OCL expressions on the specified context object, which is an instance of some
classifier in the client's model. |
Environment |
createOperationContext(Environment parent,
Operation operation)
Creates an environment suitable for parsing OCL expressions on the specified operation , which is some operation
in the client's metamodel. |
Environment |
createPropertyContext(Environment parent,
Property property)
Creates an environment suitable for parsing OCL expressions on the specified property , which is some attribute
in the client's metamodel. |
Environment |
loadEnvironment(org.eclipse.emf.ecore.resource.Resource resource)
Loads an environment from the specified resource. |
Method Detail |
---|
@NonNull Environment createEnvironment()
@NonNull Environment loadEnvironment(@NonNull org.eclipse.emf.ecore.resource.Resource resource)
resource
- a resource containing the persisted environment@NonNull Environment createClassifierContext(@NonNull Environment parent, @NonNull Type context)
context
, which is some classifier
in the client's model.
context
- the context classifier
#createOperationContext(Environment, Object)
,
#createAttributeContext(Environment, Object)
,
createInstanceContext(Environment, Object)
@NonNull Environment createInstanceContext(@NonNull Environment parent, @NonNull java.lang.Object context)
context
object, which is an instance of some
classifier in the client's model.
The context may be an instance of a model class or a data type value
on which an OCL expression would be evaluated. Note that the actual OCL
context classifier (as an OCL type or classifier) will be
inferred from the context instance according to the metamodel that the
environment factory supports, if possible. If not possible, then the
OclAny
type is assumed.
context
- the context object or value
#createClassifierContext(Environment, Object)
,
DomainStandardLibrary#getOclAny()
@NonNull Environment createOperationContext(@NonNull Environment parent, @NonNull Operation operation)
operation
, which is some operation
in the client's metamodel. Note that operation contexts can be defined
in the context of any classifier to which that operation is applicable.
parent
- the parent environment, defining the classifier contextoperation
- an operation in the client's metamodel
#createClassifierContext(Environment, Object)
@NonNull Environment createPropertyContext(@NonNull Environment parent, @NonNull Property property)
property
, which is some attribute
in the client's metamodel. Note that attribute contexts can be defined
in the context of any classifier in which that attribute is available.
parent
- the parent environment, defining the classifier contextproperty
- an attribute in the client's metamodel
#createClassifierContext(Environment, Object)
@NonNull Environment createEnvironment(@NonNull Environment parent)
parent
, for
definition of nested scopes.
parent
- the parent environment
@NonNull EvaluationEnvironment createEvaluationEnvironment()
@NonNull EvaluationEnvironment createEvaluationEnvironment(@NonNull EvaluationEnvironment parent)
parent
- a nesting evaluation environment
@NonNull EvaluationVisitor createEvaluationVisitor(@NonNull Environment env, @NonNull EvaluationEnvironment evalEnv, @NonNull DomainModelManager modelManager)
env
- the environment in which the expression was originally parsed
(or some compatible environment)evalEnv
- the evaluation environment that the visitor is to use
for tracking variables, navigating properties, etc.modelManager
- the map of Classes to their extends
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |