org.eclipse.ocl.ecore
Interface EnvironmentWithHiddenOpposites

All Superinterfaces:
Environment<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>
All Known Implementing Classes:
EcoreEnvironment

public interface EnvironmentWithHiddenOpposites
extends Environment<org.eclipse.emf.ecore.EPackage,org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EStructuralFeature,org.eclipse.emf.ecore.EEnumLiteral,org.eclipse.emf.ecore.EParameter,org.eclipse.emf.ecore.EObject,CallOperationAction,SendSignalAction,Constraint,org.eclipse.emf.ecore.EClass,org.eclipse.emf.ecore.EObject>

Adds methods regarding lookup and navigation of "hidden" opposite properties to Environment and is implemented by AbstractEnvironment.

Since:
3.1
Author:
Axel Uhl

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.Environment
Environment.Internal<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>, Environment.Lookup<PK,C,O,P>, Environment.Registry
 
Field Summary
 
Fields inherited from interface org.eclipse.ocl.Environment
OCL_NAMESPACE_URI, RESULT_VARIABLE_NAME, SELF_VARIABLE_NAME
 
Method Summary
 java.util.Map<java.lang.String,org.eclipse.emf.ecore.EReference> getHiddenOppositeProperties(org.eclipse.emf.ecore.EClassifier classifier)
          Finds all EReferences whose type is classifier or any of classifier's super types and that own an annotation with source EMOFExtendedMetaData.EMOF_PACKAGE_NS_URI_2_0 containing a detail entry with key OppositeEndFinder.PROPERTY_OPPOSITE_ROLE_NAME_KEY.
 org.eclipse.emf.ecore.EClassifier getOppositePropertyType(org.eclipse.emf.ecore.EClassifier owner, org.eclipse.emf.ecore.EReference property)
          Determines a property's (hidden) opposite's type, assuming that there is not real opposite but that the opposite's type implicitly defaults to the property's owning class.
 Variable<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EParameter> lookupImplicitSourceForOppositeProperty(java.lang.String name)
          Return the most appropriate matching variable to use as the implicit source of a call to the specified property.
 org.eclipse.emf.ecore.EReference lookupOppositeProperty(org.eclipse.emf.ecore.EClassifier owner, java.lang.String name)
          Finds a property defined or inherited by the specified classifier, based on a hidden opposite's name which is specified in an annotation on the property.
 
Methods inherited from interface org.eclipse.ocl.Environment
addElement, defineAttribute, defineOperation, deleteElement, getAdditionalAttributes, getAdditionalOperations, getBodyCondition, getContextClassifier, getContextOperation, getContextPackage, getContextProperty, getDefinition, getDeriveConstraint, getFactory, getInitConstraint, getOCLFactory, getOCLStandardLibrary, getParent, getSelfVariable, getStates, getTypeResolver, getUMLReflection, getVariables, isEmpty, isInPostcondition, lookup, lookupAssociationClassReference, lookupClassifier, lookupImplicitSourceForAssociationClass, lookupImplicitSourceForOperation, lookupImplicitSourceForProperty, lookupImplicitSourceForSignal, lookupImplicitSourceForState, lookupLocal, lookupOperation, lookupPackage, lookupProperty, lookupSignal, lookupState, setBodyCondition, setDeriveConstraint, setInitConstraint, setParent, setSelfVariable, undefine
 

Method Detail

lookupOppositeProperty

org.eclipse.emf.ecore.EReference lookupOppositeProperty(org.eclipse.emf.ecore.EClassifier owner,
                                                        java.lang.String name)
                                                        throws LookupException
Finds a property defined or inherited by the specified classifier, based on a hidden opposite's name which is specified in an annotation on the property.

Parameters:
owner - the owner of the "hidden" (non-existing) property that we are looking for, or null to find an implicit owner type (in iteration expressions)
name - the property name
Returns:
the opposite property, or null if it could not be found
Throws:
LookupException

lookupImplicitSourceForOppositeProperty

Variable<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EParameter> lookupImplicitSourceForOppositeProperty(java.lang.String name)
Return the most appropriate matching variable to use as the implicit source of a call to the specified property. Variables are returned based on inner-most scope first.

Parameters:
name - the property name
Returns:
the matching variable, or null if no appropriate variable can be found whose type defines a property of this name

getOppositePropertyType

org.eclipse.emf.ecore.EClassifier getOppositePropertyType(org.eclipse.emf.ecore.EClassifier owner,
                                                          org.eclipse.emf.ecore.EReference property)
Determines a property's (hidden) opposite's type, assuming that there is not real opposite but that the opposite's type implicitly defaults to the property's owning class.


getHiddenOppositeProperties

java.util.Map<java.lang.String,org.eclipse.emf.ecore.EReference> getHiddenOppositeProperties(org.eclipse.emf.ecore.EClassifier classifier)
Finds all EReferences whose type is classifier or any of classifier's super types and that own an annotation with source EMOFExtendedMetaData.EMOF_PACKAGE_NS_URI_2_0 containing a detail entry with key OppositeEndFinder.PROPERTY_OPPOSITE_ROLE_NAME_KEY. The value of the annotation detail is entered into the resulting map as a key, the EReference on which the annotation was found is entered into the result map as the corresponding value.

Returns:
a non-null map of all "hidden references" accessible from classifier together with their corresponding forward references