org.eclipse.ocl.examples.impactanalyzer.editor
Class Revalidator

java.lang.Object
  extended by org.eclipse.ocl.examples.impactanalyzer.Revalidator
      extended by org.eclipse.ocl.examples.impactanalyzer.editor.Revalidator

public class Revalidator
extends Revalidator

Use at the end of your EMF sample editor's createModel() method to request instant re-validation of your editor's EMF model with corresponding error marker creation/deletion. Example:

        public class MyEditor 
        extends MultiPageEditorPart
        implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {

Author:
Axel Uhl (d043530)

Constructor Summary
Revalidator(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, org.eclipse.emf.ecore.EPackage... pkgs)
          Uses the default OCLFactory.INSTANCE to create OCL objects, as well as a DefaultOppositeEndFinder.
Revalidator(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, OCLFactory oclFactory, org.eclipse.emf.ecore.EPackage... pkgs)
          Uses a DefaultOppositeEndFinder
Revalidator(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, OCLFactory oclFactory, OppositeEndFinder oppositeEndFinder, org.eclipse.emf.ecore.EPackage... pkgs)
          Uses the default OCLFactory.INSTANCE with the provided opposite end finder to create OCL instances
Revalidator(org.eclipse.emf.ecore.resource.ResourceSet resourceSet, OppositeEndFinder oppositeEndFinder, org.eclipse.emf.ecore.EPackage... pkgs)
           
 
Method Summary
protected  org.eclipse.emf.common.notify.Adapter getAdapter(java.lang.String constraintName, OCLExpression invariant, ImpactAnalyzer impactAnalyzer)
          Returns an adapter that will be notified when the constraint whose name is given by the constraintName parameter may have changed its value due to the change Notification delivered to the adapter.
 
Methods inherited from class org.eclipse.ocl.examples.impactanalyzer.Revalidator
getOclFactory, getOppositeEndFinder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Revalidator

public Revalidator(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                   OCLFactory oclFactory,
                   org.eclipse.emf.ecore.EPackage... pkgs)
Uses a DefaultOppositeEndFinder


Revalidator

public Revalidator(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                   org.eclipse.emf.ecore.EPackage... pkgs)
Uses the default OCLFactory.INSTANCE to create OCL objects, as well as a DefaultOppositeEndFinder.


Revalidator

public Revalidator(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                   OCLFactory oclFactory,
                   OppositeEndFinder oppositeEndFinder,
                   org.eclipse.emf.ecore.EPackage... pkgs)
Uses the default OCLFactory.INSTANCE with the provided opposite end finder to create OCL instances


Revalidator

public Revalidator(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
                   OppositeEndFinder oppositeEndFinder,
                   org.eclipse.emf.ecore.EPackage... pkgs)
Parameters:
oclFactory - used to create OCL instances
oppositeEndFinder - used to instantiate an OCL object using OCLFactory.createOCL(OppositeEndFinder), and used for the ImpactAnalyzer when retrieving and navigating hidden opposite references as well as for evaluating allInstances() expressions
pkgs - the metamodel packages whose invariants to observe
Method Detail

getAdapter

protected org.eclipse.emf.common.notify.Adapter getAdapter(java.lang.String constraintName,
                                                           OCLExpression invariant,
                                                           ImpactAnalyzer impactAnalyzer)
Returns an adapter that will be notified when the constraint whose name is given by the constraintName parameter may have changed its value due to the change Notification delivered to the adapter. Using the impactAnalyzer's ImpactAnalyzer.getContextObjects(Notification) operation the adapter can determine the context objects for which a re-evaluation may be necessary.

Specified by:
getAdapter in class Revalidator
Parameters:
constraintName - name of the invariant / constraint that may have changed its value based on a model change
invariant - the OCL expression that defined the invariant / constraint
impactAnalyzer - can be used by the adapter to infer the context objects on which re-evaluation may be necessary
Returns:
an adapter that will be notified about model changes within the ResourceSet specified during construction of this Revalidator that may impact the value of the constraint / invariant specified by constraintName and invariant