|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 ModelManager |
modelManager
|
protected TypeManager |
typeManager
|
protected ValueFactory |
valueFactory
|
Fields inherited from class org.eclipse.ocl.examples.pivot.util.AbstractVisitor |
---|
context |
Constructor Summary | |
---|---|
protected |
AbstractEvaluationVisitor(Environment env,
EvaluationEnvironment evalEnv,
ModelManager 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. |
ModelManager |
getModelManager()
Obtains the mapping of model classes to their extents. |
TypeManager |
getTypeManager()
|
protected EvaluationVisitor |
getUndecoratedVisitor()
Obtains the visitor on which I perform nested Visitable#accept(org.eclipse.ocl.utilities.Visitor) calls. |
ValueFactory |
getValueFactory()
|
protected EvaluationVisitor |
getVisitor()
Deprecated. use getUndecoratedVisitor() |
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,
OclExpression 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 |
---|
createNestedVisitor |
Field Detail |
---|
protected final EvaluationEnvironment evaluationEnvironment
protected final Environment environment
protected final TypeManager typeManager
protected final ModelManager modelManager
protected final ValueFactory valueFactory
Constructor Detail |
---|
protected AbstractEvaluationVisitor(Environment env, EvaluationEnvironment evalEnv, ModelManager modelManager)
env
- the current environmentevalEnv
- an evaluation environment (map of variable names to values)modelManager
- a map of classes to their instance setsMethod Detail |
---|
public Environment getEnvironment()
EvaluationVisitor
getEnvironment
in interface EvaluationVisitor
public EvaluationEnvironment getEvaluationEnvironment()
EvaluationVisitor
getEvaluationEnvironment
in interface EvaluationVisitor
public ModelManager getModelManager()
EvaluationVisitor
getModelManager
in interface EvaluationVisitor
public TypeManager getTypeManager()
getTypeManager
in interface EvaluationVisitor
protected final 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()
getValueFactory
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 void setUndecoratedVisitor(EvaluationVisitor evaluationVisitor)
Visitable#accept(org.eclipse.ocl.utilities.Visitor)
calls.
setUndecoratedVisitor
in interface EvaluationVisitor
visitor
- my delegate visitorgetUndecoratedVisitor()
public NullValue throwInvalidEvaluation(java.lang.String message) throws InvalidEvaluationException
throwInvalidEvaluation
in interface EvaluationVisitor
InvalidEvaluationException
public NullValue throwInvalidEvaluation(InvalidValueException e) throws InvalidEvaluationException
throwInvalidEvaluation
in interface EvaluationVisitor
InvalidEvaluationException
public NullValue throwInvalidEvaluation(java.lang.Throwable e, OclExpression expression, java.lang.Object value, java.lang.String message, java.lang.Object... bindings)
throwInvalidEvaluation
in interface EvaluationVisitor
public java.lang.String toString()
toString
in class java.lang.Object
public Value visitConstraint(Constraint constraint)
#visitExpression(OCLExpression)
.
visitConstraint
in interface Visitor<Value,java.lang.Object>
visitConstraint
in class AbstractExtendingVisitor<Value,java.lang.Object>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |