org.eclipse.ocl.ecore.delegate
Class InvocationBehavior
java.lang.Object
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>
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
InvocationBehavior
public InvocationBehavior()
appliesTo
public boolean appliesTo(org.eclipse.emf.ecore.EOperation operation)
cacheOCLExpression
public void cacheOCLExpression(org.eclipse.emf.ecore.EOperation operation,
OCLExpression e)
- Creates an
ExpressionCacheAdapter
for expression e
and adds
it to operation
's adapter list so that getCachedOCLExpression(EOperation)
will return e
when called for operation
. To achieve this, any other
ExpressionCacheAdapter
in operation
's adapter list is removed.
- Parameters:
e
- if null
, any existing cache entry is removed and no new entry
is created. getCachedOCLExpression(EOperation)
will then return null
.- Since:
- 3.1
getCachedOCLExpression
public OCLExpression getCachedOCLExpression(org.eclipse.emf.ecore.EOperation operation)
- Looks for an
ExpressionCacheAdapter
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