org.eclipse.ocl.examples.pivot.validation
Class LoadableConstraintDescriptor<T>

java.lang.Object
  extended by org.eclipse.emf.validation.service.AbstractConstraintDescriptor
      extended by org.eclipse.ocl.examples.pivot.validation.LoadableConstraintDescriptor<T>
All Implemented Interfaces:
org.eclipse.emf.validation.model.IModelConstraint, org.eclipse.emf.validation.service.IConstraintDescriptor
Direct Known Subclasses:
LoadableConstraintDescriptor.Ecore, LoadableConstraintDescriptor.UML

public abstract class LoadableConstraintDescriptor<T>
extends org.eclipse.emf.validation.service.AbstractConstraintDescriptor
implements org.eclipse.emf.validation.model.IModelConstraint

A LoadableConstraintDescriptor realizes both an IConstraintDescriptor and IModelConstraint to support a Constraint derived from loading some model source. The resulting desciptor is suitable for use with the EMF.Valitation framework.


Nested Class Summary
static class LoadableConstraintDescriptor.Ecore
           
static class LoadableConstraintDescriptor.UML
           
 
Field Summary
protected  T targetType
           
 
Fields inherited from interface org.eclipse.emf.validation.model.IModelConstraint
STATUS_CODE_SUCCESS
 
Constructor Summary
LoadableConstraintDescriptor(T targetType, Constraint constraint, java.lang.String targetNamespace, java.lang.String targetName, int code)
           
 
Method Summary
 java.lang.String getBody()
           
 java.lang.String getDescription()
           
 org.eclipse.emf.validation.model.EvaluationMode<?> getEvaluationMode()
           
 java.lang.String getId()
           
 java.lang.String getMessagePattern()
           
 java.lang.String getName()
           
 java.lang.String getPluginId()
           
 org.eclipse.emf.validation.model.ConstraintSeverity getSeverity()
           
 int getStatusCode()
           
 boolean targetsEvent(org.eclipse.emf.common.notify.Notification notification)
           
 org.eclipse.core.runtime.IStatus validate(org.eclipse.emf.validation.IValidationContext ctx)
           
 
Methods inherited from class org.eclipse.emf.validation.service.AbstractConstraintDescriptor
addCategory, equals, getCategories, getDescriptor, getException, hashCode, isBatch, isEnabled, isError, isLive, removeCategory, setEnabled, setError, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.validation.model.IModelConstraint
getDescriptor
 
Methods inherited from interface org.eclipse.emf.validation.service.IConstraintDescriptor
targetsTypeOf
 

Field Detail

targetType

@NonNull
protected final T targetType
Constructor Detail

LoadableConstraintDescriptor

public LoadableConstraintDescriptor(@NonNull
                                    T targetType,
                                    @NonNull
                                    Constraint constraint,
                                    java.lang.String targetNamespace,
                                    java.lang.String targetName,
                                    int code)
Method Detail

getBody

public java.lang.String getBody()
Specified by:
getBody in interface org.eclipse.emf.validation.service.IConstraintDescriptor

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface org.eclipse.emf.validation.service.IConstraintDescriptor

getEvaluationMode

public org.eclipse.emf.validation.model.EvaluationMode<?> getEvaluationMode()
Specified by:
getEvaluationMode in interface org.eclipse.emf.validation.service.IConstraintDescriptor

getId

public java.lang.String getId()
Specified by:
getId in interface org.eclipse.emf.validation.service.IConstraintDescriptor

getMessagePattern

public java.lang.String getMessagePattern()
Specified by:
getMessagePattern in interface org.eclipse.emf.validation.service.IConstraintDescriptor

getName

public java.lang.String getName()
Specified by:
getName in interface org.eclipse.emf.validation.service.IConstraintDescriptor

getPluginId

public java.lang.String getPluginId()
Specified by:
getPluginId in interface org.eclipse.emf.validation.service.IConstraintDescriptor

getSeverity

public org.eclipse.emf.validation.model.ConstraintSeverity getSeverity()
Specified by:
getSeverity in interface org.eclipse.emf.validation.service.IConstraintDescriptor

getStatusCode

public int getStatusCode()
Specified by:
getStatusCode in interface org.eclipse.emf.validation.service.IConstraintDescriptor

targetsEvent

public boolean targetsEvent(org.eclipse.emf.common.notify.Notification notification)
Specified by:
targetsEvent in interface org.eclipse.emf.validation.service.IConstraintDescriptor

validate

public org.eclipse.core.runtime.IStatus validate(org.eclipse.emf.validation.IValidationContext ctx)
Specified by:
validate in interface org.eclipse.emf.validation.model.IModelConstraint