org.eclipse.ocl.ecore.delegate
Class OCLDelegateDomain

java.lang.Object
  extended by org.eclipse.ocl.ecore.delegate.OCLDelegateDomain
All Implemented Interfaces:
DelegateDomain

public class OCLDelegateDomain
extends java.lang.Object
implements DelegateDomain

An implementation of a delegate domain for an OCL enhanced package. The domain maintains an OCL facade to be shared by all delegates within the package.

Since:
3.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.ecore.delegate.DelegateDomain
DelegateDomain.Factory
 
Field Summary
protected  org.eclipse.emf.ecore.EPackage ePackage
           
static java.lang.String KEY_FOR_ENVIRONMENT_FACTORY_CLASS
          If the EPackage annotation with source OCL_DELEGATE_URI has a detail using this key, the value is the fully qualified name of the class to be used as the EnvironmentFactory for parsing and evaluation for OCL constraints defined in the EPackage.
protected  OCL ocl
           
static java.lang.String OCL_DELEGATE_URI
          Deprecated. use OCLConstants.OCL_DELEGATE_URI
static java.lang.String OCL_DELEGATES_USE_HIDDEN_OPPOSITES_KEY
          If the EPackage annotation with source OCL_DELEGATE_URI has a detail using this key with a value of "true", the EcoreEnvironmentFactoryWithHiddenOpposites is used instead of the default EcoreEnvironmentFactory, making the OCL environment used by the delegates support "hidden opposites" and the OppositePropertyCallExp.
protected  java.lang.String uri
           
 
Constructor Summary
OCLDelegateDomain(java.lang.String delegateURI, org.eclipse.emf.ecore.EPackage ePackage)
          Initializes me with my delegate URI and package.
 
Method Summary
 void dispose()
          Dispose of this delegate domain releasing any resources cached to support delegated behaviour for the associated package.
 OCL getOCL()
           
 java.lang.String getURI()
          Get the delegate domain name.
static void initialize(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Initialize the resourceSet registries, if non-null, or the global registries, if null, to support usage of the LPG OCL Delegate Evaluator for the LPG OCL Delegate URI.
static void initialize(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.lang.String oclDelegateURI)
          Initialize the resourceSet registries, if non-null, or the global registries, if null, to support usage of the LPG OCL Delegate Evaluator for the oclDelegateURI.
static void initializeMappingFrom(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, java.lang.String oclDelegateURI)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OCL_DELEGATE_URI

@Deprecated
public static final java.lang.String OCL_DELEGATE_URI
Deprecated. use OCLConstants.OCL_DELEGATE_URI
The EAnnotation source URI for delegate OCL annotations.

For an EOperation, the EAnnotation details may include
a body key to provide an OCL expression value that specifies body: of the operation.
a precondition key to provide an OCL expression value that specifies pre: for the operation.
a postcondition key to provide an OCL expression value that specifies post: for the operation.

For an EStructuralFeature, the EAnnotation details may include
a derivation key to provide an OCL expression value that specifies derive: for the property.
a initial key to provide an OCL expression value that specifies initial: for the operation.

For an EClassifier (EClass, EDataType), the EAnnotation details may include
a constraintName key to provide an OCL expression value that specifies inv constraintName: for the classifier.

For an EPackage, the EAnnotation details may include
an environmentFactoryClass key whose value is the fully qualified class name for the EnvironmentFactory. If no key is specified either the EcoreEnvironmentFactory or EcoreEnvironmentFactoryWithHiddenOpposites class are used.
a hiddenOpposites key that may have a true value to use the EcoreEnvironmentFactoryWithHiddenOpposites class rather than the EcoreEnvironmentFactory when no environmentFactoryClass key is specified.

Note that the delegate OCL functionality must be enabled by an EPackage Ecore annotation specifying this URI as the value of invocationDelegates, settingDelegates and validationDelegates details keys.

Note also that validation must be enabled by specifying an EClassifier Ecore annotation with a space separated list of invariant constraintNames as the value of the constraints details key.

See /org.eclipse.ocl.ecore.tests/model/Company.ecore or http://wiki.eclipse.org/MDT/OCLinEcore for an example.

See Also:
Constant Field Values

KEY_FOR_ENVIRONMENT_FACTORY_CLASS

public static final java.lang.String KEY_FOR_ENVIRONMENT_FACTORY_CLASS
If the EPackage annotation with source OCL_DELEGATE_URI has a detail using this key, the value is the fully qualified name of the class to be used as the EnvironmentFactory for parsing and evaluation for OCL constraints defined in the EPackage. The class must have a a constructor that takes a single EPackage.Registry argument.

Since:
3.1
See Also:
Constant Field Values

OCL_DELEGATES_USE_HIDDEN_OPPOSITES_KEY

public static final java.lang.String OCL_DELEGATES_USE_HIDDEN_OPPOSITES_KEY
If the EPackage annotation with source OCL_DELEGATE_URI has a detail using this key with a value of "true", the EcoreEnvironmentFactoryWithHiddenOpposites is used instead of the default EcoreEnvironmentFactory, making the OCL environment used by the delegates support "hidden opposites" and the OppositePropertyCallExp.

Since:
3.1
See Also:
Constant Field Values

uri

protected final java.lang.String uri

ePackage

protected final org.eclipse.emf.ecore.EPackage ePackage

ocl

protected final OCL ocl
Constructor Detail

OCLDelegateDomain

public OCLDelegateDomain(java.lang.String delegateURI,
                         org.eclipse.emf.ecore.EPackage ePackage)
Initializes me with my delegate URI and package.

Parameters:
delegateURI - the delegate namespace I handle
ePackage - the package that I handle
Throws:
ParserException - if the operation's OCL body expression is invalid
Method Detail

initialize

public static void initialize(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Initialize the resourceSet registries, if non-null, or the global registries, if null, to support usage of the LPG OCL Delegate Evaluator for the LPG OCL Delegate URI.

Since:
3.2

initialize

public static void initialize(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                              java.lang.String oclDelegateURI)
Initialize the resourceSet registries, if non-null, or the global registries, if null, to support usage of the LPG OCL Delegate Evaluator for the oclDelegateURI.

Since:
3.2

initializeMappingFrom

public static void initializeMappingFrom(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                                         java.lang.String oclDelegateURI)
Since:
3.2

dispose

public void dispose()
Description copied from interface: DelegateDomain
Dispose of this delegate domain releasing any resources cached to support delegated behaviour for the associated package.

Specified by:
dispose in interface DelegateDomain

getOCL

public OCL getOCL()

getURI

public java.lang.String getURI()
Description copied from interface: DelegateDomain
Get the delegate domain name.

Specified by:
getURI in interface DelegateDomain
Returns:
the delegate URI

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object