|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ocl.AbstractEnvironmentFactory<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject>
org.eclipse.ocl.uml.UMLEnvironmentFactory
public class UMLEnvironmentFactory
Implementation of the 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.ocl.EnvironmentFactory |
---|
EnvironmentFactory.Lookup<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
Constructor Summary | |
---|---|
UMLEnvironmentFactory()
Initializes me. |
|
UMLEnvironmentFactory(org.eclipse.emf.ecore.EPackage.Registry registry,
org.eclipse.emf.ecore.resource.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(org.eclipse.emf.ecore.resource.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. |
Method Summary | |
---|---|
UMLEnvironment |
createEnvironment()
Creates a root environment, in which package contexts and/or classifier contexts will be created as nested environments. |
Environment<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> |
createEnvironment(Environment<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> parent)
Creates a child environment of a specified parent , for
definition of nested scopes. |
EvaluationEnvironment<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> |
createEvaluationEnvironment()
Creates a new evaluation environment to track the values of variables in an OCL expression as it is evaluated. |
EvaluationEnvironment<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> |
createEvaluationEnvironment(EvaluationEnvironment<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> parent)
Creates a new evaluation environment as a nested environment of the specified parent. |
protected org.eclipse.uml2.uml.Classifier |
getClassifier(java.lang.Object context)
Obtains client metamodel's classifier for the specified context object, which may be an instance of a classifier
in the user model or may actually be a classifier in the user model. |
org.eclipse.emf.ecore.EPackage.Registry |
getEPackageRegistry()
Obtains the package registry that the environment I create will use to look up the Ecore definitions of UML packages. |
org.eclipse.emf.ecore.resource.ResourceSet |
getResourceSet()
Obtains the resource set that the environment I create will use to find UML packages. |
protected org.eclipse.uml2.uml.Package |
getUMLMetamodel()
Obtains the UML metamodel library, loaded in my resource set. |
Environment<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> |
loadEnvironment(org.eclipse.emf.ecore.resource.Resource resource)
Loads an environment from the specified resource. |
protected org.eclipse.uml2.uml.Package |
lookupPackage(java.util.List<java.lang.String> pathname)
Looks up the package identified by the specified qualified name by whatever means is appropriate to the particular environment implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UMLEnvironmentFactory()
public UMLEnvironmentFactory(org.eclipse.emf.ecore.resource.ResourceSet rset)
rset
- my resource set (must not by null
)public UMLEnvironmentFactory(org.eclipse.emf.ecore.EPackage.Registry registry, org.eclipse.emf.ecore.resource.ResourceSet rset)
registry
- my package registry (must not be null
)rset
- my resource set (must not be null
)Method Detail |
---|
public UMLEnvironment createEnvironment()
EnvironmentFactory
public Environment<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> loadEnvironment(org.eclipse.emf.ecore.resource.Resource resource)
EnvironmentFactory
resource
- a resource containing the persisted environmentpublic final org.eclipse.emf.ecore.EPackage.Registry getEPackageRegistry()
public final org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
protected org.eclipse.uml2.uml.Package getUMLMetamodel()
protected org.eclipse.uml2.uml.Package lookupPackage(java.util.List<java.lang.String> pathname)
AbstractEnvironmentFactory
lookupPackage
in class AbstractEnvironmentFactory<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject>
pathname
- the qualified name of the package to find
null
if none is foundprotected org.eclipse.uml2.uml.Classifier getClassifier(java.lang.Object context)
AbstractEnvironmentFactory
context
object, which may be an instance of a classifier
in the user model or may actually be a classifier in the user model.
getClassifier
in class AbstractEnvironmentFactory<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject>
context
- a context object or classifier
public Environment<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> createEnvironment(Environment<org.eclipse.uml2.uml.Package,org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.EnumerationLiteral,org.eclipse.uml2.uml.Parameter,org.eclipse.uml2.uml.State,org.eclipse.uml2.uml.CallOperationAction,org.eclipse.uml2.uml.SendSignalAction,org.eclipse.uml2.uml.Constraint,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> parent)
EnvironmentFactory
parent
, for
definition of nested scopes.
parent
- the parent environment
public EvaluationEnvironment<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> createEvaluationEnvironment()
EnvironmentFactory
public EvaluationEnvironment<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> createEvaluationEnvironment(EvaluationEnvironment<org.eclipse.uml2.uml.Classifier,org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Property,org.eclipse.uml2.uml.Class,org.eclipse.emf.ecore.EObject> parent)
EnvironmentFactory
parent
- a nesting evaluation environment
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |