|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.examples.pivot.util.AbstractVisitor<R,C>
org.eclipse.ocl.examples.pivot.util.AbstractExtendingVisitor<Value,java.lang.Object>
org.eclipse.ocl.examples.pivot.evaluation.AbstractEvaluationVisitor
public abstract class AbstractEvaluationVisitor
An evaluation visitor implementation for OCL expressions.
Note that this class is not intended to be used or extended by
clients. Use the AbstractEvaluationVisitor interface, instead.
See the Environment class for a description of the
generic type parameters of this class.
| Field Summary | |
|---|---|
protected Environment |
environment
|
protected EvaluationEnvironment |
evaluationEnvironment
|
protected MetaModelManager |
metaModelManager
|
protected DomainModelManager |
modelManager
|
protected ValueFactory |
valueFactory
|
| Fields inherited from class org.eclipse.ocl.examples.pivot.util.AbstractVisitor |
|---|
context |
| Constructor Summary | |
|---|---|
protected |
AbstractEvaluationVisitor(Environment env,
EvaluationEnvironment evalEnv,
DomainModelManager modelManager)
Initializes me. |
| Method Summary | |
|---|---|
Environment |
getEnvironment()
Obtains the environment that provides the metamodel semantics for the expression to be evaluated. |
EvaluationEnvironment |
getEvaluationEnvironment()
Obtains the evaluation environment that keeps track of variable values and knows how to call operations, navigate properties, etc. |
MetaModelManager |
getMetaModelManager()
|
DomainModelManager |
getModelManager()
Obtains the mapping of model classes to their extents. |
DomainStandardLibrary |
getStandardLibrary()
|
protected EvaluationVisitor |
getUndecoratedVisitor()
Obtains the visitor on which I perform nested Visitable#accept(org.eclipse.ocl.utilities.Visitor) calls. |
ValueFactory |
getValueFactory()
Return the factory for values and indirectly for types. |
protected EvaluationVisitor |
getVisitor()
Deprecated. use getUndecoratedVisitor() |
boolean |
isCanceled()
Return true if the evaluation has been canceled. |
void |
setCanceled(boolean isCanceled)
Request cancelation of the current the evaluation, or reset the request for a new evaluation. |
void |
setUndecoratedVisitor(EvaluationVisitor evaluationVisitor)
Sets the visitor on which I perform nested Visitable#accept(org.eclipse.ocl.utilities.Visitor) calls. |
NullValue |
throwInvalidEvaluation(InvalidValueException e)
|
NullValue |
throwInvalidEvaluation(java.lang.String message)
|
NullValue |
throwInvalidEvaluation(java.lang.Throwable e,
DomainExpression expression,
java.lang.Object value,
java.lang.String message,
java.lang.Object... bindings)
|
java.lang.String |
toString()
|
Value |
visitConstraint(Constraint constraint)
This default implementation asserts that the constraint is boolean-valued if it is an invariant, pre-condition, or post-condition constraint and returns the value of its body expression by delegation to #visitExpression(OCLExpression). |
| Methods inherited from class org.eclipse.ocl.examples.pivot.util.AbstractVisitor |
|---|
getAdapter, safeVisit, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitor |
|---|
createNestedEvaluator, evaluate, getEvaluator |
| Field Detail |
|---|
protected final EvaluationEnvironment evaluationEnvironment
protected final Environment environment
protected final MetaModelManager metaModelManager
protected final DomainModelManager modelManager
protected final ValueFactory valueFactory
| Constructor Detail |
|---|
protected AbstractEvaluationVisitor(Environment env,
EvaluationEnvironment evalEnv,
DomainModelManager modelManager)
env - the current environmentevalEnv - an evaluation environment (map of variable names to values)modelManager - a map of classes to their instance sets| Method Detail |
|---|
public Environment getEnvironment()
EvaluationVisitor
getEnvironment in interface EvaluationVisitorpublic EvaluationEnvironment getEvaluationEnvironment()
EvaluationVisitor
getEvaluationEnvironment in interface DomainEvaluatorgetEvaluationEnvironment in interface EvaluationVisitorpublic MetaModelManager getMetaModelManager()
getMetaModelManager in interface EvaluationVisitorpublic DomainModelManager getModelManager()
EvaluationVisitor
getModelManager in interface DomainEvaluatorgetModelManager in interface EvaluationVisitorpublic DomainStandardLibrary getStandardLibrary()
getStandardLibrary in interface EvaluationVisitorprotected EvaluationVisitor getUndecoratedVisitor()
Visitable#accept(org.eclipse.ocl.utilities.Visitor) calls. This
handles the case in which I am decorated by another visitor that must
intercept every visitXxx() method. If I internally just
recursively visit myself, then this decorator is cut out of the picture.
public ValueFactory getValueFactory()
DomainEvaluator
getValueFactory in interface DomainEvaluatorgetValueFactory in interface EvaluationVisitor@Deprecated protected final EvaluationVisitor getVisitor()
getUndecoratedVisitor()
Visitable#accept(org.eclipse.ocl.utilities.Visitor) calls. This
handles the case in which I am decorated by another visitor that must
intercept every visitXxx() method. If I internally just
recursively visit myself, then this decorator is cut out of the picture.
public boolean isCanceled()
DomainEvaluator
isCanceled in interface DomainEvaluatorpublic void setCanceled(boolean isCanceled)
DomainEvaluatorEvaluationHaltedException when #getValuefactory()
is next invoked.
setCanceled in interface DomainEvaluatorpublic void setUndecoratedVisitor(EvaluationVisitor evaluationVisitor)
Visitable#accept(org.eclipse.ocl.utilities.Visitor) calls.
setUndecoratedVisitor in interface EvaluationVisitorvisitor - my delegate visitorgetUndecoratedVisitor()
public NullValue throwInvalidEvaluation(java.lang.String message)
throws InvalidEvaluationException
throwInvalidEvaluation in interface EvaluationVisitorInvalidEvaluationException
public NullValue throwInvalidEvaluation(InvalidValueException e)
throws InvalidEvaluationException
throwInvalidEvaluation in interface DomainEvaluatorthrowInvalidEvaluation in interface EvaluationVisitorInvalidEvaluationException
public NullValue throwInvalidEvaluation(java.lang.Throwable e,
DomainExpression expression,
java.lang.Object value,
java.lang.String message,
java.lang.Object... bindings)
throwInvalidEvaluation in interface DomainEvaluatorthrowInvalidEvaluation in interface EvaluationVisitorpublic java.lang.String toString()
toString in class java.lang.Objectpublic Value visitConstraint(Constraint constraint)
#visitExpression(OCLExpression).
visitConstraint in interface Visitor<Value>visitConstraint in class AbstractExtendingVisitor<Value,java.lang.Object>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||