|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.emf.ocl.parser.EcoreEnvironment
org.eclipse.emf.ocl.internal.parser.ReverseCompatibilityEnvironment
public class ReverseCompatibilityEnvironment
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.emf.ocl.parser.EcoreEnvironment |
|---|
EcoreEnvironment.Access |
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.emf.ocl.parser.Environment |
|---|
ANNOTATION_URI_BODY, ANNOTATION_URI_DEFINE, ANNOTATION_URI_DERIVE, ANNOTATION_URI_INIT |
| Method Summary | |
|---|---|
boolean |
addElement(String name,
Variable elem,
boolean imp)
Adds a variable declaration to the environment. |
void |
deleteElement(String name)
Removes a name when it goes out of scope. |
EClass |
getAssociationClass(EReference reference)
Obtains the association class that the specified reference represents, as an EClass, if any. |
EClassifier |
getContextClassifier()
Obtains the context classifier of this environment. |
EOperation |
getContextOperation()
Obtains the context operation of this environment, if it is an operation context. |
EStructuralFeature |
getContextProperty()
Obtains the context property of this environment, if it is a property context. |
String |
getDescription(ENamedElement namedElement)
Default implementation just gets the name of the named element's eClass or, if it is an
ETypedElement, the name of its type. |
EList |
getMemberEnds(EClass associationClass)
Obtains the ends of the specified association class as a list of EReferences. |
EList |
getQualifiers(EStructuralFeature property)
Gets the qualifiers of an association end. |
Variable |
getSelfVariable()
Gets the self variable, looking it up in a parent environment if necessary. |
EList |
getSignals(EClassifier owner)
By default, return an empty list because Ecore does not support the modeling of signals. |
String |
getStateName(EObject state)
Ecore does not model states, so this method returns null. |
EList |
getStates(EClassifier owner,
List pathPrefix)
Obtains the states matching the specified path prefix in the owner type by trying the EcoreEnvironment.collectStates(org.eclipse.emf.ecore.EClassifier, java.util.List, java.util.List) method on it and, recursively, its
supertypes to find all matches. |
Collection |
getVariables()
Returns the Variables registered in me explicitly. |
boolean |
isAssociationClass(EClass eclass)
Determines whether the specified eclass is an association
class. |
boolean |
isEmpty()
Is the environment empty? |
boolean |
isQuery(EOperation operation)
Determines whether the specified operation is a query
operation. |
Variable |
lookup(String name)
returns the VariableDeclaration for a variable Looks in parent environment scope if not found in current scope. |
EClass |
lookupAssociationClassReference(EClassifier parent,
String name)
Find reference in the specified class to the named association class. |
Variable |
lookupImplicitSourceForAssociationClass(String name)
Return the variable declaration in namedElements which references the named association class. |
Variable |
lookupImplicitSourceForOperation(String name,
EList params)
Return the Variable declaration in namedElements which contains the name as an EOperation. |
Variable |
lookupImplicitSourceForProperty(String name)
Return the most appropriate matching variable to use as the implicit source of a call to the specified property. |
Variable |
lookupLocal(String name)
Returns the VariableDeclaration for a variable name. |
EOperation |
lookupOperation(EClassifier owner,
String name,
EList args)
Find the operation in the specified class. |
EPackage |
lookupPackage(List names)
Finds the EPackage corresponding to the path: name::... |
EClassifier |
lookupPathName(List names)
Finds the EClassifier corresponding to the path: name::... |
EStructuralFeature |
lookupProperty(EClassifier parent,
String name)
Find a property defined or inherited by the specified classifier. |
EClass |
lookupSignal(EClassifier owner,
String name,
EList args)
Find a received signal in the specified classifier. |
void |
setSelfVariable(Variable var)
Sets the "self" variable that is the implicit source of any attribute, association end, or operation call. |
| Methods inherited from class org.eclipse.emf.ocl.parser.EcoreEnvironment |
|---|
collectStates, createTypeResolver, findPackage, findPackage, getFactory, getOCLCollectionType, getOCLType, getOCLType, getParent, getTypeResolver, initialLower, setContextOperation, setContextProperty, setFactory, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean addElement(String name,
Variable elem,
boolean imp)
EcoreEnvironment
addElement in interface EnvironmentaddElement in class EcoreEnvironmentelem - --
variable declarationimp - --
is the variable implicit?
public void deleteElement(String name)
EcoreEnvironment
deleteElement in interface EnvironmentdeleteElement in class EcoreEnvironmentpublic EClass getAssociationClass(EReference reference)
EcoreEnvironmentEClass, if any. This gets the "class" aspect of the
association class, for which the reference represents the "association"
aspect. Note that an environment that correctly supports association
classes would need to supply appropriately annotated EReferences.
getAssociationClass in interface EnvironmentgetAssociationClass in class EcoreEnvironmentreference - a reference
null if the reference
does not represent an association classpublic EClassifier getContextClassifier()
Environment
getContextClassifier in interface EnvironmentgetContextClassifier in class EcoreEnvironmentpublic EOperation getContextOperation()
Environment
getContextOperation in interface EnvironmentgetContextOperation in class EcoreEnvironmentnull if this is not an
operation environmentpublic EStructuralFeature getContextProperty()
Environment
getContextProperty in interface EnvironmentgetContextProperty in class EcoreEnvironmentnull if this is not a
property environmentpublic String getDescription(ENamedElement namedElement)
EcoreEnvironmenteClass or, if it is an
ETypedElement, the name of its type.
getDescription in interface EnvironmentgetDescription in class EcoreEnvironmentnamedElement - a named element obtained by adaptation of a user
model element
public EList getMemberEnds(EClass associationClass)
EcoreEnvironmentEReferences. Note that an environment that correctly supports
association classes would need to supply appropriately annotated
EClasses.
getMemberEnds in interface EnvironmentgetMemberEnds in class EcoreEnvironmentassociationClass - an EClass representing an association class
EReferences representing its member ends (the
association roles)public EList getQualifiers(EStructuralFeature property)
EcoreEnvironmentEReferences.
getQualifiers in interface EnvironmentgetQualifiers in class EcoreEnvironmentproperty - a property of the model class
EStructuralFeatures, or an
empty list if the property has no qualifierspublic Variable getSelfVariable()
Environment
getSelfVariable in interface EnvironmentgetSelfVariable in class EcoreEnvironmentnull if none (which should not
happen as there is always some classifier context)public EList getSignals(EClassifier owner)
EcoreEnvironment
getSignals in interface EnvironmentgetSignals in class EcoreEnvironmentowner - the owner type of the signal receptions
EClasses), or an empty list if nonepublic String getStateName(EObject state)
EcoreEnvironment
getStateName in interface EnvironmentgetStateName in class EcoreEnvironmentstate - representation of a UML state
public EList getStates(EClassifier owner,
List pathPrefix)
EcoreEnvironmentEcoreEnvironment.collectStates(org.eclipse.emf.ecore.EClassifier, java.util.List, java.util.List) method on it and, recursively, its
supertypes to find all matches. For implicit (null) owners,
looks up the innermost-scoped variable as the implicit source and tries
again on this variable's type.
To extend this implementation, override the
EcoreEnvironment.collectStates(org.eclipse.emf.ecore.EClassifier, java.util.List, java.util.List) method.
getStates in interface EnvironmentgetStates in class EcoreEnvironmentowner - the classifier for which states are being sought. Can be
null in the case of an oclIsInState() call on an
implicit targetpathPrefix - partial path name of the states being sought. This
can be empty to find the first level of state names
public Collection getVariables()
EnvironmentVariables registered in me explicitly.
getVariables in interface EnvironmentgetVariables in class EcoreEnvironmentpublic boolean isAssociationClass(EClass eclass)
EcoreEnvironmenteclass is an association
class. Note that an environment that correctly supports association
classes would need to supply appropriately annotated EClasses.
isAssociationClass in interface EnvironmentisAssociationClass in class EcoreEnvironmenteclass - an Ecore class
public boolean isEmpty()
EcoreEnvironment
isEmpty in interface EnvironmentisEmpty in class EcoreEnvironmentpublic boolean isQuery(EOperation operation)
EcoreEnvironmentoperation is a query
operation. Note that an environment that correctly supports query
operations would need to supply appropriately annotated
EOperations or otherwise override this method.
isQuery in interface EnvironmentisQuery in class EcoreEnvironmentoperation - an operation
EOperation that
is not annotated is considered to be a query by defaultpublic Variable lookup(String name)
EcoreEnvironment
lookup in interface Environmentlookup in class EcoreEnvironment
public EClass lookupAssociationClassReference(EClassifier parent,
String name)
Environment
lookupAssociationClassReference in interface EnvironmentlookupAssociationClassReference in class EcoreEnvironmentparent - the referencing class to searchname - the association class name (with an initial lower case as
per the OCL convention)
null if the specified
parent classifier does not have any references
implemented by the named association classpublic Variable lookupImplicitSourceForAssociationClass(String name)
Environment
lookupImplicitSourceForAssociationClass in interface EnvironmentlookupImplicitSourceForAssociationClass in class EcoreEnvironmentname - the association class name to seek
null if none
is found
public Variable lookupImplicitSourceForOperation(String name,
EList params)
throws SemanticException
Environment
lookupImplicitSourceForOperation in interface EnvironmentlookupImplicitSourceForOperation in class EcoreEnvironmentSemanticExceptionpublic Variable lookupImplicitSourceForProperty(String name)
Environment
lookupImplicitSourceForProperty in interface EnvironmentlookupImplicitSourceForProperty in class EcoreEnvironmentname - the property name
public Variable lookupLocal(String name)
EcoreEnvironment
lookupLocal in interface EnvironmentlookupLocal in class EcoreEnvironment
public EOperation lookupOperation(EClassifier owner,
String name,
EList args)
Environment
lookupOperation in interface EnvironmentlookupOperation in class EcoreEnvironmentowner - the owner type of the called operationname - the name of the called operationargs - the arguments (as OCLExpressions) passed to the operation
null if not foundpublic EPackage lookupPackage(List names)
Environmentnull.
lookupPackage in interface EnvironmentlookupPackage in class EcoreEnvironmentnames - the path name
null if not foundpublic EClassifier lookupPathName(List names)
EcoreEnvironment
lookupPathName in interface EnvironmentlookupPathName in class EcoreEnvironment
public EStructuralFeature lookupProperty(EClassifier parent,
String name)
Environment
lookupProperty in interface EnvironmentlookupProperty in class EcoreEnvironmentparent - the owner of the property that we are looking for, or
null to find an implicit owner typename - the property name
null if it could not be found
public EClass lookupSignal(EClassifier owner,
String name,
EList args)
Environment
lookupSignal in interface EnvironmentlookupSignal in class EcoreEnvironmentowner - the owner type of the signal receptionname - the name of the signalargs - the arguments (as OCLExpressions) passed in the signal
null if not foundpublic void setSelfVariable(Variable var)
Environment
setSelfVariable in interface EnvironmentsetSelfVariable in class EcoreEnvironmentvar - the "self" variable
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||