|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.examples.pivot.utilities.ConstraintEvaluator<T>
T - the result typepublic abstract class ConstraintEvaluator<T>
ConstraintEvaluator provides an abstract framework for evaluation of a constraint with call backs to handle the alternative success, failure, invalid and exception outcomes and return an appropriate value of T.
| Field Summary | |
|---|---|
protected ExpressionInOCL |
expression
|
| Constructor Summary | |
|---|---|
ConstraintEvaluator(ExpressionInOCL expression)
Construct an helper for the evaluation of an expression |
|
| Method Summary | |
|---|---|
T |
evaluate(EvaluationVisitor evaluationVisitor)
Use the evaluationVisitor to execute my expression on the objects within the evaluationVisitor's evaluationEnvironment, invoking one of handleSuccessResult, handleFailureResult, handleInvalidResult or handleExceptionResult to provide the return value. |
protected java.lang.String |
getConstraintName()
|
protected java.lang.String |
getConstraintResultMessage(java.lang.Object result)
Return the message of result, which is null unless result is a Tuple with a more informative severity part. |
protected int |
getConstraintResultSeverity(java.lang.Object result)
Return the org.eclipse.emf.common.util.Diagnostic severity of result, which is ERROR unless result is a Tuple with a more informative severity part. |
protected boolean |
getConstraintResultStatus(java.lang.Object result)
Return true if result represents a successful constraint evaluation result. |
protected java.lang.String |
getConstraintTypeName()
|
protected abstract java.lang.String |
getObjectLabel()
Call-back to provide a description of the context object for use in a diagnostic. |
protected abstract T |
handleExceptionResult(java.lang.Throwable e)
Call-back to return the appropriate response for an evaluation that was terminated by an exception. |
protected abstract T |
handleFailureResult(java.lang.Object result)
Call-back to return the appropriate response for a failed evaluation. |
protected abstract T |
handleInvalidExpression(java.lang.String message)
Call-back to return the appropriate response for an unsuccessful parse of the expression. |
protected abstract T |
handleInvalidResult(InvalidValueException e)
Call-back to return the appropriate response for an unsuccessful evaluation with an invalid result. |
protected abstract T |
handleSuccessResult()
Call-back to return the appropriate response for a successful evaluation. |
protected boolean |
isBooleanConstraint()
Return true if the constraint has a Boolean result type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@NonNull protected final ExpressionInOCL expression
| Constructor Detail |
|---|
public ConstraintEvaluator(@NonNull
ExpressionInOCL expression)
| Method Detail |
|---|
public T evaluate(@NonNull
EvaluationVisitor evaluationVisitor)
protected java.lang.String getConstraintName()
@NonNull
protected java.lang.String getConstraintResultMessage(@Nullable
java.lang.Object result)
protected int getConstraintResultSeverity(@Nullable
java.lang.Object result)
protected boolean getConstraintResultStatus(@Nullable
java.lang.Object result)
protected java.lang.String getConstraintTypeName()
protected abstract java.lang.String getObjectLabel()
protected abstract T handleExceptionResult(@NonNull
java.lang.Throwable e)
protected abstract T handleFailureResult(@Nullable
java.lang.Object result)
protected abstract T handleInvalidExpression(@NonNull
java.lang.String message)
protected abstract T handleInvalidResult(@NonNull
InvalidValueException e)
protected abstract T handleSuccessResult()
protected boolean isBooleanConstraint()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||