org.eclipse.ocl.ecore.delegate
Class ValidationBehavior

java.lang.Object
  extended by org.eclipse.ocl.ecore.delegate.AbstractDelegatedBehavior<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EValidator.ValidationDelegate.Registry,ValidationDelegate.Factory>
      extended by org.eclipse.ocl.ecore.delegate.ValidationBehavior
All Implemented Interfaces:
DelegatedBehavior<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EValidator.ValidationDelegate.Registry,ValidationDelegate.Factory>

public class ValidationBehavior
extends AbstractDelegatedBehavior<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EValidator.ValidationDelegate.Registry,ValidationDelegate.Factory>

Since:
3.0

Nested Class Summary
protected static class ValidationBehavior.InvariantCacheAdapter
          Caches the OCL invariants of an EClassifier.
 
Nested classes/interfaces inherited from class org.eclipse.ocl.ecore.delegate.AbstractDelegatedBehavior
AbstractDelegatedBehavior.ExpressionCacheAdapter
 
Field Summary
static ValidationBehavior INSTANCE
           
static java.lang.String NAME
           
 
Fields inherited from class org.eclipse.ocl.ecore.delegate.AbstractDelegatedBehavior
NO_OCL_DEFINITION
 
Constructor Summary
ValidationBehavior()
           
 
Method Summary
 void cacheOCLExpression(org.eclipse.emf.ecore.EClassifier cls, java.lang.String constraintName, OCLExpression e)
          Creates an OCLInvariantCacheAdapter for expression e and adds it to n's adapter list so that #getCachedOCLExpression(Notifier) will return e when called for n.
 OCLExpression getCachedOCLExpression(org.eclipse.emf.ecore.EClassifier cls, java.lang.String constraintName)
          Looks for an OCLInvariantCacheAdapter attached to cls.
 ValidationDelegate.Factory getDefaultFactory()
           
 org.eclipse.emf.ecore.EValidator.ValidationDelegate.Registry getDefaultRegistry()
           
 org.eclipse.emf.ecore.EPackage getEPackage(org.eclipse.emf.ecore.EClassifier eClassifier)
           
 ValidationDelegate.Factory getFactory(DelegateDomain delegateDomain, org.eclipse.emf.ecore.EClassifier eClassifier)
           
 java.lang.Class<ValidationDelegate.Factory> getFactoryClass()
           
 OCLExpression getInvariant(org.eclipse.emf.ecore.EClassifier cls, java.lang.String constraintName, OCL ocl)
           
 java.lang.String getName()
           
 java.lang.Class<ValidationDelegate.Factory.Registry> getRegistryClass()
           
 
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 ValidationBehavior INSTANCE

NAME

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

ValidationBehavior

public ValidationBehavior()
Method Detail

getDefaultFactory

public ValidationDelegate.Factory getDefaultFactory()

getDefaultRegistry

public org.eclipse.emf.ecore.EValidator.ValidationDelegate.Registry getDefaultRegistry()

getEPackage

public org.eclipse.emf.ecore.EPackage getEPackage(org.eclipse.emf.ecore.EClassifier eClassifier)

getFactory

public ValidationDelegate.Factory getFactory(DelegateDomain delegateDomain,
                                             org.eclipse.emf.ecore.EClassifier eClassifier)
Specified by:
getFactory in class AbstractDelegatedBehavior<org.eclipse.emf.ecore.EClassifier,org.eclipse.emf.ecore.EValidator.ValidationDelegate.Registry,ValidationDelegate.Factory>

getFactoryClass

public java.lang.Class<ValidationDelegate.Factory> getFactoryClass()

cacheOCLExpression

public void cacheOCLExpression(org.eclipse.emf.ecore.EClassifier cls,
                               java.lang.String constraintName,
                               OCLExpression e)
Creates an OCLInvariantCacheAdapter for expression e and adds it to n's adapter list so that #getCachedOCLExpression(Notifier) will return e when called for n. To achieve this, any other OCLInvariantCacheAdapter in n's adapter list is removed.

Parameters:
e - if null, the respective cache entry for constraintName is removed.
Since:
3.1

getCachedOCLExpression

public OCLExpression getCachedOCLExpression(org.eclipse.emf.ecore.EClassifier cls,
                                            java.lang.String constraintName)
Looks for an OCLInvariantCacheAdapter attached to cls. If such an adapter is found, a cached expression for constraintName 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

getInvariant

public OCLExpression getInvariant(org.eclipse.emf.ecore.EClassifier cls,
                                  java.lang.String constraintName,
                                  OCL ocl)
Since:
3.1

getName

public java.lang.String getName()

getRegistryClass

public java.lang.Class<ValidationDelegate.Factory.Registry> getRegistryClass()