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<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
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).
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.
Modifier and Type | Interface and Description |
---|---|
static interface |
EnvironmentFactory.Lookup<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
Optional adapter interface for look-up methods that throw
LookupException s on abnormal failures (usually ambiguous names). |
Modifier and Type | Method and Description |
---|---|
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createAttributeContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent,
P property)
Creates an environment suitable for parsing OCL expressions on the
specified
property , which is some attribute
in the client's metamodel. |
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createClassifierContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent,
C context)
Creates an environment suitable for parsing OCL expressions in the
specified
context , which is some classifier
in the client's model. |
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createEnvironment()
Creates a root environment, in which package contexts and/or classifier
contexts will be created as nested environments.
|
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createEnvironment(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent)
Creates a child environment of a specified
parent , for
definition of nested scopes. |
EvaluationEnvironment<C,O,P,CLS,E> |
createEvaluationEnvironment()
Creates a new evaluation environment to track the values of variables in
an OCL expression as it is evaluated.
|
EvaluationEnvironment<C,O,P,CLS,E> |
createEvaluationEnvironment(EvaluationEnvironment<C,O,P,CLS,E> parent)
Creates a new evaluation environment as a nested environment of the
specified parent.
|
EvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createEvaluationVisitor(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
EvaluationEnvironment<C,O,P,CLS,E> evalEnv,
java.util.Map<? extends CLS,? extends java.util.Set<? extends E>> extentMap)
Creates a new evaluation visitor, for the evaluation of OCL expressions.
|
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createInstanceContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> 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. |
OCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createOCLAnalyzer(AbstractOCLParser parser)
Creates an instance of the OCLAnalyzer that will use
a given parser to perform syntactic and lexical analysis.
|
OCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createOCLAnalyzer(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment,
java.lang.String input)
Creates an instance of the OCLAnalyzer that analyzes the
given input on behalf of this environment.
|
OCLFactoryWithHistory |
createOCLFactoryWithHistory(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
Creates an instance of the OCLFactoryWithHistory object for this environment.
|
OCLSyntaxHelper |
createOCLSyntaxHelper(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
Creates an instance of the OCLSyntaxHelper object for this environment.
|
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createOperationContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent,
O operation)
Creates an environment suitable for parsing OCL expressions on the
specified
operation , which is some operation
in the client's metamodel. |
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
createPackageContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent,
java.util.List<java.lang.String> pathname)
Creates an environment suitable for parsing OCL expressions in the
specified package context.
|
Visitor<java.lang.Boolean,C,O,P,EL,PM,S,COA,SSA,CT> |
createValidationVisitor(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
Obtains an instance of the validation visitor that validates against the
specified environment, which presumably was used in parsing the OCL in
the first place.
|
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
loadEnvironment(org.eclipse.emf.ecore.resource.Resource resource)
Loads an environment from the specified resource.
|
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createEnvironment()
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createPackageContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent, java.util.List<java.lang.String> pathname)
pathname
- the qualified package name (the "::"-separated parts)createClassifierContext(org.eclipse.ocl.Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>, C)
,
createOperationContext(org.eclipse.ocl.Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>, O)
,
createAttributeContext(org.eclipse.ocl.Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>, P)
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> loadEnvironment(org.eclipse.emf.ecore.resource.Resource resource)
resource
- a resource containing the persisted environmentEnvironment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createClassifierContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent, C context)
context
, which is some classifier
in the client's model.context
- the context classifiercreateOperationContext(Environment, Object)
,
createAttributeContext(Environment, Object)
,
createInstanceContext(Environment, Object)
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createInstanceContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent, 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 valuecreateClassifierContext(Environment, Object)
,
OCLStandardLibrary.getOclAny()
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createOperationContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent, O 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 metamodelcreateClassifierContext(Environment, Object)
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createAttributeContext(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent, P 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 metamodelcreateClassifierContext(Environment, Object)
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createEnvironment(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> parent)
parent
, for
definition of nested scopes.parent
- the parent environmentEvaluationEnvironment<C,O,P,CLS,E> createEvaluationEnvironment()
EvaluationEnvironment<C,O,P,CLS,E> createEvaluationEnvironment(EvaluationEnvironment<C,O,P,CLS,E> parent)
parent
- a nesting evaluation environmentEvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createEvaluationVisitor(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env, EvaluationEnvironment<C,O,P,CLS,E> evalEnv, java.util.Map<? extends CLS,? extends java.util.Set<? extends E>> extentMap)
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.extentMap
- the map of Classes to their extendsOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createOCLAnalyzer(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment, java.lang.String input)
input
- the text to be analyzedOCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createOCLAnalyzer(AbstractOCLParser parser)
parser
- performing syntax analysisOCLFactoryWithHistory createOCLFactoryWithHistory(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
env
- an OCL environment (must not be null
)OCLSyntaxHelper createOCLSyntaxHelper(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
environment
- an OCL environment (must not be null
)Visitor<java.lang.Boolean,C,O,P,EL,PM,S,COA,SSA,CT> createValidationVisitor(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> environment)
environment
- an OCL environment (must not be null
)