public class UMLEnvironmentFactory extends AbstractEnvironmentFactory<Package,Classifier,Operation,Property,EnumerationLiteral,Parameter,State,CallOperationAction,SendSignalAction,Constraint,Class,EObject>
EnvironmentFactory
for parsing OCL expressions
on UML models.
The parser environments created by the UML environment factory support OCL
expressions at both the metamodel (M2) and user model (M1) levels. For
user model constraints, use the classifier in the model as the context
classifier in invocations of an OCL
or an OCLHelper
created by it. For metamodel OCL (used, for example, to query the user
model, itself) use the metaclass of any element in the user model as the
context classifier. A convenient way to obtain this metaclass is via the
OCLUMLUtil#getMetaclass(org.eclipse.uml2.uml.Element)
method.
Constructor and Description |
---|
UMLEnvironmentFactory()
Initializes me.
|
UMLEnvironmentFactory(EPackage.Registry registry,
ResourceSet rset)
Initializes me with a resource set and package registry that the
environments I create will use to look up UML packages and
their Ecore definitions.
|
UMLEnvironmentFactory(ResourceSet rset)
Initializes me with a resource set that the environments I create
will use (along with its package registry) to look up UML packages and
their Ecore definitions.
|
Modifier and Type | Method and Description |
---|---|
UMLEnvironment |
createEnvironment()
Creates a root environment, in which package contexts and/or classifier
contexts will be created as nested environments.
|
Environment<Package,Classifier,Operation,Property,EnumerationLiteral,Parameter,State,CallOperationAction,SendSignalAction,Constraint,Class,EObject> |
createEnvironment(Environment<Package,Classifier,Operation,Property,EnumerationLiteral,Parameter,State,CallOperationAction,SendSignalAction,Constraint,Class,EObject> parent)
Creates a child environment of a specified
parent , for
definition of nested scopes. |
EvaluationEnvironment<Classifier,Operation,Property,Class,EObject> |
createEvaluationEnvironment()
Creates a new evaluation environment to track the values of variables in
an OCL expression as it is evaluated.
|
EvaluationEnvironment<Classifier,Operation,Property,Class,EObject> |
createEvaluationEnvironment(EvaluationEnvironment<Classifier,Operation,Property,Class,EObject> parent)
Creates a new evaluation environment as a nested environment of the
specified parent.
|
EPackage.Registry |
getEPackageRegistry()
Obtains the package registry that the environment I create will use to
look up the Ecore definitions of UML packages.
|
ResourceSet |
getResourceSet()
Obtains the resource set that the environment I create will use to
find UML packages.
|
Environment<Package,Classifier,Operation,Property,EnumerationLiteral,Parameter,State,CallOperationAction,SendSignalAction,Constraint,Class,EObject> |
loadEnvironment(Resource resource)
Loads an environment from the specified resource.
|
createAttributeContext, createClassifierContext, createEvaluationVisitor, createInstanceContext, createOCLAnalyzer, createOCLAnalyzer, createOCLFactoryWithHistory, createOCLSyntaxHelper, createOperationContext, createPackageContext, createValidationVisitor, getAdapter
public UMLEnvironmentFactory()
public UMLEnvironmentFactory(ResourceSet rset)
rset
- my resource set (must not by null
)public UMLEnvironmentFactory(EPackage.Registry registry, ResourceSet rset)
registry
- my package registry (must not be null
)rset
- my resource set (must not be null
)public UMLEnvironment createEnvironment()
EnvironmentFactory
public Environment<Package,Classifier,Operation,Property,EnumerationLiteral,Parameter,State,CallOperationAction,SendSignalAction,Constraint,Class,EObject> loadEnvironment(Resource resource)
EnvironmentFactory
resource
- a resource containing the persisted environmentpublic final EPackage.Registry getEPackageRegistry()
public final ResourceSet getResourceSet()
public Environment<Package,Classifier,Operation,Property,EnumerationLiteral,Parameter,State,CallOperationAction,SendSignalAction,Constraint,Class,EObject> createEnvironment(Environment<Package,Classifier,Operation,Property,EnumerationLiteral,Parameter,State,CallOperationAction,SendSignalAction,Constraint,Class,EObject> parent)
EnvironmentFactory
parent
, for
definition of nested scopes.parent
- the parent environmentpublic EvaluationEnvironment<Classifier,Operation,Property,Class,EObject> createEvaluationEnvironment()
EnvironmentFactory
public EvaluationEnvironment<Classifier,Operation,Property,Class,EObject> createEvaluationEnvironment(EvaluationEnvironment<Classifier,Operation,Property,Class,EObject> parent)
EnvironmentFactory
parent
- a nesting evaluation environmentCopyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.