org.eclipse.ocl.ecore.delegate
Class InvocationBehavior

java.lang.Object
  extended by org.eclipse.ocl.ecore.delegate.AbstractDelegatedBehavior<org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory.Registry,org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory>
      extended by org.eclipse.ocl.ecore.delegate.InvocationBehavior
All Implemented Interfaces:
DelegatedBehavior<org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory.Registry,org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory>

public class InvocationBehavior
extends AbstractDelegatedBehavior<org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory.Registry,org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory>

Since:
3.0

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ocl.ecore.delegate.AbstractDelegatedBehavior
AbstractDelegatedBehavior.ExpressionCacheAdapter
 
Field Summary
static java.lang.String BODY_CONSTRAINT_KEY
           
static InvocationBehavior INSTANCE
           
static java.lang.String NAME
           
 
Fields inherited from class org.eclipse.ocl.ecore.delegate.AbstractDelegatedBehavior
NO_OCL_DEFINITION
 
Constructor Summary
InvocationBehavior()
           
 
Method Summary
 boolean appliesTo(org.eclipse.emf.ecore.EOperation operation)
           
 void cacheOCLExpression(org.eclipse.emf.ecore.EOperation operation, OCLExpression e)
          Creates an OCLExpressionCacheAdapter for expression e and adds it to operation's adapter list so that #getCachedOCLExpression(Notifier) will return e when called for operation.
 OCLExpression getCachedOCLExpression(org.eclipse.emf.ecore.EOperation operation)
          Looks for an OCLExpressionCacheAdapter attached to operation.
 org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory getDefaultFactory()
           
 org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory.Registry getDefaultRegistry()
           
 org.eclipse.emf.ecore.EPackage getEPackage(org.eclipse.emf.ecore.EOperation eOperation)
           
 org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory getFactory(DelegateDomain delegateDomain, org.eclipse.emf.ecore.EOperation eOperation)
           
 java.lang.Class<org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory> getFactoryClass()
           
 java.lang.String getName()
           
 OCLExpression getOperationBody(OCL ocl, org.eclipse.emf.ecore.EOperation operation)
          Return the operation body associated with operation, if necessary using ocl to create the relevant parsing environment for a textual definition.
 java.lang.Class<org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory.Registry> getRegistryClass()
           
 boolean hasCompileableOperationBody(org.eclipse.emf.ecore.EOperation operation)
          Tells if there is a textual expression for the operation in an annotation that can be compiled by getOperationBody(OCL, EOperation).
 
Methods inherited from class org.eclipse.ocl.ecore.delegate.AbstractDelegatedBehavior
getDelegatedBehaviors, getDelegateDomains, getFactories, getFactory, isNoOCLDefinition, setDelegates, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final InvocationBehavior INSTANCE

BODY_CONSTRAINT_KEY

public static final java.lang.String BODY_CONSTRAINT_KEY
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

InvocationBehavior

public InvocationBehavior()
Method Detail

appliesTo

public boolean appliesTo(org.eclipse.emf.ecore.EOperation operation)

cacheOCLExpression

public void cacheOCLExpression(org.eclipse.emf.ecore.EOperation operation,
                               OCLExpression e)
Creates an OCLExpressionCacheAdapter for expression e and adds it to operation's adapter list so that #getCachedOCLExpression(Notifier) will return e when called for operation. To achieve this, any other OCLExpressionCacheAdapter in operation's adapter list is removed.

Parameters:
e - if null, any existing cache entry is removed and no new entry is created. #getCachedOCLExpression(Notifier) will then return null.
Since:
3.1

getCachedOCLExpression

public OCLExpression getCachedOCLExpression(org.eclipse.emf.ecore.EOperation operation)
Looks for an OCLExpressionCacheAdapter attached to operation. If such an adapter is found, its cached expression is returned. The cached expression may be a reserved expression indicating that no OCL expression exists and that an unsuccessful attempt to obtain one has been made before. AbstractDelegatedBehavior.isNoOCLDefinition(OCLExpression) should be used to check for the reserved expression. null is returned if no cached expression is available.

Since:
3.1

getDefaultFactory

public org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory getDefaultFactory()

getDefaultRegistry

public org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory.Registry getDefaultRegistry()

getEPackage

public org.eclipse.emf.ecore.EPackage getEPackage(org.eclipse.emf.ecore.EOperation eOperation)

getFactory

public org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory getFactory(DelegateDomain delegateDomain,
                                                                                       org.eclipse.emf.ecore.EOperation eOperation)
Specified by:
getFactory in class AbstractDelegatedBehavior<org.eclipse.emf.ecore.EOperation,org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory.Registry,org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory>

getFactoryClass

public java.lang.Class<org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory> getFactoryClass()

getName

public java.lang.String getName()

getOperationBody

public OCLExpression getOperationBody(OCL ocl,
                                      org.eclipse.emf.ecore.EOperation operation)
Return the operation body associated with operation, if necessary using ocl to create the relevant parsing environment for a textual definition.


getRegistryClass

public java.lang.Class<org.eclipse.emf.ecore.EOperation.Internal.InvocationDelegate.Factory.Registry> getRegistryClass()

hasCompileableOperationBody

public boolean hasCompileableOperationBody(org.eclipse.emf.ecore.EOperation operation)
Tells if there is a textual expression for the operation in an annotation that can be compiled by getOperationBody(OCL, EOperation). Probing this saves callers the more expensive construction of an OCL object.

Since:
3.1