org.eclipse.ocl.examples.pivot.validation
Class PivotEObjectValidator.ValidationAdapter

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.AdapterImpl
      extended by org.eclipse.ocl.examples.pivot.validation.PivotEObjectValidator.ValidationAdapter
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal
Enclosing class:
PivotEObjectValidator

public static class PivotEObjectValidator.ValidationAdapter
extends org.eclipse.emf.common.notify.impl.AdapterImpl

A ValidationAdapter is installed in the ResourceSet of applications that register for additional PIvot-defined constraints. The standard validation is performed by PivotEObjectValidator.INSTANCE before additional functionality is provided by the ValidationAdapter. For non-Pivot applications the ValidationAdapter adapts the ResourceSet containing the validatable (Ecore) instances. Validation is invoked for validatable (Ecore) instances. For Pivot applications the ValidationAdapter adapts the ResourceSet containing the validatable metamodel elements. Validation is invoked for validatable (Pivot) elements so a redirection via the MetaModelManager is needed to find the ValidationAdapter on the externalResourceSet.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
protected  EnvironmentFactory environmentFactory
           
protected  MetaModelManager metaModelManager
           
protected  Environment rootEnvironment
           
 
Fields inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
target
 
Constructor Summary
PivotEObjectValidator.ValidationAdapter(MetaModelManager metaModelManager)
           
 
Method Summary
static PivotEObjectValidator.ValidationAdapter findAdapter(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
           
 MetaModelManager getMetaModelManager()
           
 org.eclipse.emf.common.util.Diagnostic validate(Constraint constraint, java.lang.Object object, java.util.Map<java.lang.Object,java.lang.Object> context)
          Validate constraint for object using context to elaborate the validation context.
 boolean validate(org.eclipse.emf.ecore.EClassifier eClassifier, java.lang.Object object, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          Validate all of eClassifier's constraints for object, appending warnings and at most one error to diagnostics using context to elaborate the validation context.
 
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
getTarget, isAdapterForType, notifyChanged, setTarget, unsetTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metaModelManager

@NonNull
protected final MetaModelManager metaModelManager

environmentFactory

@NonNull
protected final EnvironmentFactory environmentFactory

rootEnvironment

@NonNull
protected final Environment rootEnvironment
Constructor Detail

PivotEObjectValidator.ValidationAdapter

public PivotEObjectValidator.ValidationAdapter(@NonNull
                                               MetaModelManager metaModelManager)
Method Detail

findAdapter

public static PivotEObjectValidator.ValidationAdapter findAdapter(@NonNull
                                                                  org.eclipse.emf.ecore.resource.ResourceSet resourceSet)

getMetaModelManager

@NonNull
public MetaModelManager getMetaModelManager()

validate

public boolean validate(@NonNull
                        org.eclipse.emf.ecore.EClassifier eClassifier,
                        @Nullable
                        java.lang.Object object,
                        @Nullable
                        org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                        @Nullable
                        java.util.Map<java.lang.Object,java.lang.Object> context)
Validate all of eClassifier's constraints for object, appending warnings and at most one error to diagnostics using context to elaborate the validation context.


validate

@Nullable
public org.eclipse.emf.common.util.Diagnostic validate(@NonNull
                                                                Constraint constraint,
                                                                @Nullable
                                                                java.lang.Object object,
                                                                @Nullable
                                                                java.util.Map<java.lang.Object,java.lang.Object> context)
Validate constraint for object using context to elaborate the validation context. Returns null for no problem or a warning/error severity diagnostic for a problem.