org.eclipse.ocl.examples.validity.locator
Class UMLConstraintLocator

java.lang.Object
  extended by org.eclipse.ocl.examples.emf.validation.validity.locator.AbstractConstraintLocator
      extended by org.eclipse.ocl.examples.validity.locator.AbstractPivotConstraintLocator
          extended by org.eclipse.ocl.examples.validity.locator.UMLConstraintLocator
All Implemented Interfaces:
ConstraintLocator, ConstraintLocator.Descriptor
Direct Known Subclasses:
UMLUIConstraintLocator

public class UMLConstraintLocator
extends AbstractPivotConstraintLocator


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.validity.locator.AbstractPivotConstraintLocator
AbstractPivotConstraintLocator.AbstractConstraintLocator
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.emf.validation.validity.locator.ConstraintLocator
ConstraintLocator.Descriptor
 
Field Summary
static UMLConstraintLocator INSTANCE
           
 
Constructor Summary
UMLConstraintLocator()
           
 
Method Summary
protected  void appendPath(java.lang.StringBuilder s, org.eclipse.uml2.uml.NamedElement eObject)
           
 java.util.Set<TypeURI> getAllTypes(ValidityManager validityManager, org.eclipse.emf.ecore.EObject constrainingType)
          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.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.
 
Methods inherited from class org.eclipse.ocl.examples.validity.locator.AbstractPivotConstraintLocator
createEvaluationVisitor, getQuery
 
Methods inherited from class org.eclipse.ocl.examples.emf.validation.validity.locator.AbstractConstraintLocator
createLeafConstrainingNode, getConstraintLocator, getImage, getSeverity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

@NonNull
public static UMLConstraintLocator INSTANCE
Constructor Detail

UMLConstraintLocator

public UMLConstraintLocator()
Method Detail

appendPath

protected void appendPath(@NonNull
                          java.lang.StringBuilder s,
                          @NonNull
                          org.eclipse.uml2.uml.NamedElement eObject)

getAllTypes

@NonNull
public java.util.Set<TypeURI> getAllTypes(@NonNull
                                                  ValidityManager validityManager,
                                                  @NonNull
                                                  org.eclipse.emf.ecore.EObject constrainingType)
Description copied from interface: ConstraintLocator
Return all typeURIs for a given type; typically this returns the supertype closure.

Specified by:
getAllTypes in interface ConstraintLocator
Overrides:
getAllTypes in class AbstractConstraintLocator

getConstrainingURIs

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

Specified by:
getConstrainingURIs in interface ConstraintLocator
Overrides:
getConstrainingURIs in class AbstractConstraintLocator

getConstraints

@Nullable
public 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)
Description copied from interface: ConstraintLocator
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.


getImports

@Nullable
public 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)
Description copied from interface: ConstraintLocator
Return any resources imported from within resource.

Specified by:
getImports in interface ConstraintLocator
Overrides:
getImports in class AbstractConstraintLocator

getLabel

@NonNull
public java.lang.String getLabel(@NonNull
                                         org.eclipse.emf.ecore.EModelElement eObject)
Description copied from interface: ConstraintLocator
Return a diagnostic label for eObject.

Specified by:
getLabel in interface ConstraintLocator
Overrides:
getLabel in class AbstractConstraintLocator

getName

@NonNull
public java.lang.String getName()
Description copied from interface: ConstraintLocator
Return a descriptive name for this kind of constraint.


getSourceExpression

@Nullable
public java.lang.String getSourceExpression(@NonNull
                                                     LeafConstrainingNode node)
Description copied from interface: ConstraintLocator
Return the source representation of the Constraint. Returns null if none available.

Specified by:
getSourceExpression in interface ConstraintLocator
Overrides:
getSourceExpression in class AbstractConstraintLocator

getSourceResource

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

Specified by:
getSourceResource in interface ConstraintLocator
Overrides:
getSourceResource in class AbstractConstraintLocator

getURI

@Nullable
public org.eclipse.emf.common.util.URI getURI(@NonNull
                                                       org.eclipse.emf.ecore.EObject eObject)
Specified by:
getURI in interface ConstraintLocator
Overrides:
getURI in class AbstractConstraintLocator

validate

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

Specified by:
validate in interface ConstraintLocator
Overrides:
validate in class AbstractConstraintLocator