protected static class AbstractDelegatedBehavior.ExpressionCacheAdapter
extends org.eclipse.emf.common.notify.impl.AdapterImpl
"modifying"
the object to which the adapter gets attached.Constructor and Description |
---|
ExpressionCacheAdapter(OCLExpression expression) |
Modifier and Type | Method and Description |
---|---|
static void |
cacheOCLExpression(org.eclipse.emf.ecore.EModelElement modelElement,
OCLExpression e)
Creates an
ExpressionCacheAdapter for expression e and adds
it to modelElement 's adapter list so that getCachedOCLExpression(EModelElement)
will return e when called for modelElement . |
static OCLExpression |
getCachedOCLExpression(org.eclipse.emf.ecore.EModelElement modelElement)
Looks for an
ExpressionCacheAdapter attached to modelElement . |
OCLExpression |
getExpression() |
boolean |
isAdapterForType(java.lang.Object type) |
public ExpressionCacheAdapter(OCLExpression expression)
public static void cacheOCLExpression(org.eclipse.emf.ecore.EModelElement modelElement, OCLExpression e)
ExpressionCacheAdapter
for expression e
and adds
it to modelElement
's adapter list so that getCachedOCLExpression(EModelElement)
will return e
when called for modelElement
. To achieve this, any other
ExpressionCacheAdapter
in modelElement
's adapter list is removed.e
- if null
, any existing cache entry is removed and no new entry
is created. getCachedOCLExpression(EModelElement)
will then return null
.public static OCLExpression getCachedOCLExpression(org.eclipse.emf.ecore.EModelElement modelElement)
ExpressionCacheAdapter
attached to modelElement
.
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.public OCLExpression getExpression()
public boolean isAdapterForType(java.lang.Object type)
isAdapterForType
in interface org.eclipse.emf.common.notify.Adapter
isAdapterForType
in class org.eclipse.emf.common.notify.impl.AdapterImpl