org.eclipse.ocl.examples.pivot.delegate
Class OCLValidationDelegate
java.lang.Object
org.eclipse.ocl.examples.pivot.delegate.OCLValidationDelegate
- All Implemented Interfaces:
- org.eclipse.emf.ecore.EValidator.ValidationDelegate, ValidationDelegate, ValidationDelegateExtension
public class OCLValidationDelegate
- extends java.lang.Object
- implements ValidationDelegate
An implementation of the dynamic validation delegate API, maintaining a cache
of compiled constraints and invariants.
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.EValidator.ValidationDelegate |
org.eclipse.emf.ecore.EValidator.ValidationDelegate.Descriptor, org.eclipse.emf.ecore.EValidator.ValidationDelegate.Registry |
Constructor Summary |
OCLValidationDelegate(OCLDelegateDomain delegateDomain,
org.eclipse.emf.ecore.EClassifier classifier)
Initializes me with the classifier whose DelegateEClassifierAdapter delegates to me. |
Method Summary |
protected boolean |
check(EvaluationVisitor evaluationVisitor,
java.lang.String constraintName,
ExpressionInOCL query)
|
EvaluationEnvironment |
createEvaluationEnvironment(java.lang.Object object,
ExpressionInOCL query,
EnvironmentFactory environmentFactory)
|
EvaluationVisitor |
createEvaluationVisitor(java.lang.Object object,
ExpressionInOCL query)
|
protected java.lang.String |
evaluateMessage(EvaluationVisitor evaluationVisitor,
java.lang.String constraintName,
ExpressionInOCL query)
|
ExpressionInOCL |
getExpressionInOCL(MetaModelManager metaModelManager,
Constraint constraint)
|
java.lang.String |
toString()
|
boolean |
validate(org.eclipse.emf.ecore.EClass eClass,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context,
java.lang.String constraintName,
java.lang.String expression,
int severity,
java.lang.String source,
int code)
Evaluates the given constraint expression against the object in the given context. |
boolean |
validate(org.eclipse.emf.ecore.EClass eClass,
org.eclipse.emf.ecore.EObject eObject,
java.util.Map<java.lang.Object,java.lang.Object> context,
org.eclipse.emf.ecore.EOperation invariant,
java.lang.String expression)
|
boolean |
validate(org.eclipse.emf.ecore.EClass eClass,
org.eclipse.emf.ecore.EObject eObject,
java.util.Map<java.lang.Object,java.lang.Object> context,
java.lang.String constraintName,
java.lang.String expression)
|
boolean |
validate(org.eclipse.emf.ecore.EDataType eDataType,
java.lang.Object value,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context,
java.lang.String constraintName,
java.lang.String expression,
int severity,
java.lang.String source,
int code)
Evaluates the given constraint expression against the value in the given context. |
boolean |
validate(org.eclipse.emf.ecore.EDataType eDataType,
java.lang.Object value,
java.util.Map<java.lang.Object,java.lang.Object> context,
java.lang.String constraintName,
java.lang.String expression)
|
protected boolean |
validateExpressionInOCL(org.eclipse.emf.ecore.EClassifier eClassifier,
java.lang.Object value,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context,
java.lang.String constraintName,
java.lang.String source,
int code,
ExpressionInOCL query)
|
protected boolean |
validatePivot(org.eclipse.emf.ecore.EClassifier eClassifier,
java.lang.Object value,
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context,
java.lang.String constraintName,
java.lang.String source,
int code)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
delegateDomain
@NonNull
protected final OCLDelegateDomain delegateDomain
eClassifier
@NonNull
protected final org.eclipse.emf.ecore.EClassifier eClassifier
OCLValidationDelegate
public OCLValidationDelegate(@NonNull
OCLDelegateDomain delegateDomain,
@NonNull
org.eclipse.emf.ecore.EClassifier classifier)
- Initializes me with the classifier whose DelegateEClassifierAdapter delegates to me.
- Parameters:
classifier
- my classifier
createEvaluationVisitor
public EvaluationVisitor createEvaluationVisitor(java.lang.Object object,
ExpressionInOCL query)
createEvaluationEnvironment
public EvaluationEnvironment createEvaluationEnvironment(java.lang.Object object,
ExpressionInOCL query,
EnvironmentFactory environmentFactory)
evaluateMessage
protected java.lang.String evaluateMessage(@NonNull
EvaluationVisitor evaluationVisitor,
java.lang.String constraintName,
ExpressionInOCL query)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
validate
public boolean validate(org.eclipse.emf.ecore.EClass eClass,
org.eclipse.emf.ecore.EObject eObject,
java.util.Map<java.lang.Object,java.lang.Object> context,
org.eclipse.emf.ecore.EOperation invariant,
java.lang.String expression)
- Specified by:
validate
in interface org.eclipse.emf.ecore.EValidator.ValidationDelegate
getExpressionInOCL
@NonNull
public ExpressionInOCL getExpressionInOCL(@NonNull
MetaModelManager metaModelManager,
@NonNull
Constraint constraint)
validate
public boolean validate(org.eclipse.emf.ecore.EClass eClass,
org.eclipse.emf.ecore.EObject eObject,
java.util.Map<java.lang.Object,java.lang.Object> context,
java.lang.String constraintName,
java.lang.String expression)
- Specified by:
validate
in interface org.eclipse.emf.ecore.EValidator.ValidationDelegate
validate
public boolean validate(org.eclipse.emf.ecore.EDataType eDataType,
java.lang.Object value,
java.util.Map<java.lang.Object,java.lang.Object> context,
java.lang.String constraintName,
java.lang.String expression)
- Specified by:
validate
in interface org.eclipse.emf.ecore.EValidator.ValidationDelegate
validate
public boolean validate(@NonNull
org.eclipse.emf.ecore.EClass eClass,
@NonNull
org.eclipse.emf.ecore.EObject eObject,
@Nullable
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context,
@NonNull
java.lang.String constraintName,
java.lang.String expression,
int severity,
java.lang.String source,
int code)
- Description copied from interface:
ValidationDelegateExtension
- Evaluates the given constraint expression against the object in the given context.
- Specified by:
validate
in interface ValidationDelegateExtension
- Returns:
- the result of the expression evaluation.
validate
public boolean validate(@NonNull
org.eclipse.emf.ecore.EDataType eDataType,
@NonNull
java.lang.Object value,
@Nullable
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context,
@NonNull
java.lang.String constraintName,
java.lang.String expression,
int severity,
java.lang.String source,
int code)
- Description copied from interface:
ValidationDelegateExtension
- Evaluates the given constraint expression against the value in the given context.
- Specified by:
validate
in interface ValidationDelegateExtension
- Returns:
- the result of the expression evaluation.
validatePivot
protected boolean validatePivot(@NonNull
org.eclipse.emf.ecore.EClassifier eClassifier,
@NonNull
java.lang.Object value,
@Nullable
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context,
@NonNull
java.lang.String constraintName,
java.lang.String source,
int code)
check
protected boolean check(EvaluationVisitor evaluationVisitor,
java.lang.String constraintName,
ExpressionInOCL query)
validateExpressionInOCL
protected boolean validateExpressionInOCL(@NonNull
org.eclipse.emf.ecore.EClassifier eClassifier,
@NonNull
java.lang.Object value,
@Nullable
org.eclipse.emf.common.util.DiagnosticChain diagnostics,
java.util.Map<java.lang.Object,java.lang.Object> context,
java.lang.String constraintName,
java.lang.String source,
int code,
@NonNull
ExpressionInOCL query)