org.eclipse.ocl.examples.emf.validation.validity.locator
Interface ConstraintLocator

All Known Subinterfaces:
ConstraintUILocator
All Known Implementing Classes:
AbstractConstraintLocator, AbstractPivotConstraintLocator, DelegateConstraintLocator, DelegateUIConstraintLocator, EClassConstraintLocator, EClassifierConstraintLocator, EValidatorConstraintLocator, PivotConstraintLocator, PivotUIConstraintLocator, UMLConstraintLocator, UMLUIConstraintLocator

public interface ConstraintLocator

A ConstraintLocator supports location of a particular category of Constraint and dispatch of those constraints for validation.

The org.eclipse.ocl.examples.emf.validation.validity.constraint_locator extension point is used to register ConstraintLocators.


Nested Class Summary
static interface ConstraintLocator.Descriptor
           
 
Method Summary
 java.util.Set<TypeURI> getAllTypes(ValidityManager validityManager, org.eclipse.emf.ecore.EObject constrainingObject)
          Return all typeURIs for a given type; typically this returns the supertype closure.
 java.util.Set<ConstrainingURI> getConstrainingURIs(ValidityManager validityManager, org.eclipse.emf.ecore.EObject validatableObject)
          Return the constraining URIs of all 'types' that provide constraints for validatableObject.
 java.util.Map<org.eclipse.emf.ecore.EObject,java.util.List<LeafConstrainingNode>> getConstraints(ValidityModel validityModel, org.eclipse.emf.ecore.EPackage ePackage, java.util.Set<org.eclipse.emf.ecore.resource.Resource> resources, org.eclipse.emf.common.util.Monitor monitor)
          Return a constrainedType-to-constraint map for all types in the given resources that have an ePackage whose URI complies with the registration of this ConstraintLocator.
 java.lang.Object getImage()
          Return an icon to identify this kind of ConstraintLocator.
 java.util.Collection<org.eclipse.emf.ecore.resource.Resource> getImports(org.eclipse.emf.ecore.EPackage ePackage, org.eclipse.emf.ecore.resource.Resource resource)
          Return any resources imported from within resource.
 java.lang.String getLabel(org.eclipse.emf.ecore.EModelElement eObject)
          Return a diagnostic label for eObject.
 java.lang.String getName()
          Return a descriptive name for this kind of constraint.
 java.lang.String getSourceExpression(LeafConstrainingNode node)
          Return the source representation of the Constraint.
 org.eclipse.emf.ecore.resource.Resource getSourceResource(LeafConstrainingNode node)
          Return the Resource from which the Constraint was obtained.
 org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject eObject)
           
 void validate(Result result, ValidityManager validityManager, org.eclipse.emf.common.util.Monitor monitor)
          Update the validation result to include the verdict of the validation using validityManager to provide shared services.
 

Method Detail

getAllTypes

@NonNull
java.util.Set<TypeURI> getAllTypes(@NonNull
                                           ValidityManager validityManager,
                                           @NonNull
                                           org.eclipse.emf.ecore.EObject constrainingObject)
Return all typeURIs for a given type; typically this returns the supertype closure.


getConstrainingURIs

@Nullable
java.util.Set<ConstrainingURI> getConstrainingURIs(@NonNull
                                                            ValidityManager validityManager,
                                                            @NonNull
                                                            org.eclipse.emf.ecore.EObject validatableObject)
Return the constraining URIs of all 'types' that provide constraints for validatableObject.


getConstraints

@Nullable
java.util.Map<org.eclipse.emf.ecore.EObject,java.util.List<LeafConstrainingNode>> getConstraints(@NonNull
                                                                                                          ValidityModel validityModel,
                                                                                                          @NonNull
                                                                                                          org.eclipse.emf.ecore.EPackage ePackage,
                                                                                                          @NonNull
                                                                                                          java.util.Set<org.eclipse.emf.ecore.resource.Resource> resources,
                                                                                                          @NonNull
                                                                                                          org.eclipse.emf.common.util.Monitor monitor)
Return a constrainedType-to-constraint map for all types in the given resources that have an ePackage whose URI complies with the registration of this ConstraintLocator. The validityModel is used to create the LeafConstrainingNodes for each constraint.


getImage

@Nullable
java.lang.Object getImage()
Return an icon to identify this kind of ConstraintLocator.


getImports

@Nullable
java.util.Collection<org.eclipse.emf.ecore.resource.Resource> getImports(@NonNull
                                                                                  org.eclipse.emf.ecore.EPackage ePackage,
                                                                                  @NonNull
                                                                                  org.eclipse.emf.ecore.resource.Resource resource)
Return any resources imported from within resource.


getLabel

@NonNull
java.lang.String getLabel(@NonNull
                                  org.eclipse.emf.ecore.EModelElement eObject)
Return a diagnostic label for eObject.


getName

@NonNull
java.lang.String getName()
Return a descriptive name for this kind of constraint.


getSourceExpression

@Nullable
java.lang.String getSourceExpression(@NonNull
                                              LeafConstrainingNode node)
Return the source representation of the Constraint. Returns null if none available.


getSourceResource

@Nullable
org.eclipse.emf.ecore.resource.Resource getSourceResource(@NonNull
                                                                   LeafConstrainingNode node)
Return the Resource from which the Constraint was obtained. Returns null if none available.


getURI

@Nullable
org.eclipse.emf.common.util.URI getURI(@NonNull
                                                org.eclipse.emf.ecore.EObject eObject)

validate

void validate(@NonNull
              Result result,
              @NonNull
              ValidityManager validityManager,
              @Nullable
              org.eclipse.emf.common.util.Monitor monitor)
Update the validation result to include the verdict of the validation using validityManager to provide shared services.

Parameters:
monitor -