public abstract class AbstractEnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> extends Object implements EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>, Adaptable
EnvironmentFactory
interface, useful
for subclassing to define the OCL binding for a metamodel. This abstract
class takes care of some of the more common (and mundane) chores, such as:
The subclass's responsibility (in addition to implementing any other interface methods not implemented here) is to define how to:
This class is intended to be extended by clients, for the purpose of implementing metamodel-specific environment factories.
See the EnvironmentFactory
class for a description of the
generic type parameters of this class.
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. |
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,
Map<? extends CLS,? extends 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,
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> env,
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> env)
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,
List<String> pathname)
Creates an environment suitable for parsing OCL expressions in the
specified package context.
|
Visitor<Boolean,C,O,P,EL,PM,S,COA,SSA,CT> |
createValidationVisitor(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
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.
|
<T> T |
getAdapter(Class<T> adapterType)
The abstract environment factory implementation is adaptable.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createEnvironment, createEnvironment, createEvaluationEnvironment, createEvaluationEnvironment, loadEnvironment
public 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, List<String> pathname)
EnvironmentFactory
createPackageContext
in interface EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
pathname
- the qualified package name (the "::"-separated parts)EnvironmentFactory.createClassifierContext(org.eclipse.ocl.Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>, C)
,
EnvironmentFactory.createOperationContext(org.eclipse.ocl.Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>, O)
,
EnvironmentFactory.createAttributeContext(org.eclipse.ocl.Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>, P)
public 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)
EnvironmentFactory
context
, which is some classifier
in the client's model.createClassifierContext
in interface EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
context
- the context classifierEnvironmentFactory.createOperationContext(Environment, Object)
,
EnvironmentFactory.createAttributeContext(Environment, Object)
,
EnvironmentFactory.createInstanceContext(Environment, Object)
public 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, Object context)
EnvironmentFactory
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.
createInstanceContext
in interface EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
context
- the context object or valueEnvironmentFactory.createClassifierContext(Environment, Object)
,
OCLStandardLibrary.getOclAny()
public 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)
EnvironmentFactory
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.createOperationContext
in interface EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
parent
- the parent environment, defining the classifier contextoperation
- an operation in the client's metamodelEnvironmentFactory.createClassifierContext(Environment, Object)
public 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)
EnvironmentFactory
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.createAttributeContext
in interface EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
parent
- the parent environment, defining the classifier contextproperty
- an attribute in the client's metamodelEnvironmentFactory.createClassifierContext(Environment, Object)
public 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, Map<? extends CLS,? extends Set<? extends E>> extentMap)
EnvironmentFactory
createEvaluationVisitor
in interface EnvironmentFactory<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
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 extendspublic 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> env, String input)
EnvironmentFactory
public OCLAnalyzer<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> createOCLAnalyzer(AbstractOCLParser parser)
EnvironmentFactory
public OCLFactoryWithHistory createOCLFactoryWithHistory(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
EnvironmentFactory
public OCLSyntaxHelper createOCLSyntaxHelper(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
EnvironmentFactory
public Visitor<Boolean,C,O,P,EL,PM,S,COA,SSA,CT> createValidationVisitor(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env)
EnvironmentFactory
public <T> T getAdapter(Class<T> adapterType)
Subclasses may override or extend this implementation.
getAdapter
in interface Adaptable
T
- the requested adapter interfaceadapterType
- the requested adapter interfacenull
if this environment does not adapt to itCopyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.