|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.utilities.AbstractVisitor<Object,C,O,P,EL,PM,S,COA,SSA,CT>
org.eclipse.ocl.AbstractEvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
public abstract class AbstractEvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>
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 |
|---|
| Fields inherited from class org.eclipse.ocl.utilities.AbstractVisitor |
|---|
result |
| Constructor Summary | |
|---|---|
protected |
AbstractEvaluationVisitor(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
EvaluationEnvironment<C,O,P,CLS,E> evalEnv,
Map<? extends CLS,? extends Set<? extends E>> extentMap)
Initializes me. |
| Method Summary | |
|---|---|
protected Object |
call(O operation,
OCLExpression<C> body,
Object target,
Object[] args)
Invokes the specified additional operation on a target object. |
protected C |
getBoolean()
Obtains my environment's implementation of the OCL Boolean type. |
Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
getEnvironment()
Obtains the environment that provides the metamodel semantics for the expression to be evaluated. |
EvaluationEnvironment<C,O,P,CLS,E> |
getEvaluationEnvironment()
Obtains the evaluation environment that keeps track of variable values and knows how to call operations, navigate properties, etc. |
Map<? extends CLS,? extends Set<? extends E>> |
getExtentMap()
Obtains the mapping of model classes to their extends. |
protected C |
getInteger()
Obtains my environment's implementation of the OCL Integer type. |
protected String |
getName(Object namedElement)
Obtains the name of the specified element, if it has one. |
protected Object |
getOclInvalid()
Obtains my environment's implementation of the OclInvalid value. |
protected OCLExpression<C> |
getOperationBody(O operation)
Obtains the body of the specified operation's def or body expression, if any. |
protected OCLExpression<C> |
getPropertyBody(P property)
Obtains the body of the specified property's def or der expression, if any. |
protected C |
getReal()
Obtains my environment's implementation of the OCL Real type. |
protected ExpressionInOCL<C,PM> |
getSpecification(CT constraint)
Overridden by subclasses interested in visiting constraints, to get the constraint's specification. |
protected OCLStandardLibrary<C> |
getStandardLibrary()
Obtains my environment's OCL Standard Library implementation. |
protected C |
getString()
Obtains my environment's implementation of the OCL String type. |
protected UMLReflection<PK,C,O,P,EL,PM,S,COA,SSA,CT> |
getUMLReflection()
|
protected C |
getUnlimitedNatural()
Obtains my environment's implementation of the OCL UnlimitedNatural type. |
protected EvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> |
getVisitor()
Obtains the visitor on which I perform nested Visitable.accept(org.eclipse.ocl.utilities.Visitor) calls. |
protected boolean |
isUndefined(Object value)
Convenience method to determine whether the specified value is the null or OclInvalid. |
protected Object |
navigate(P property,
OCLExpression<C> derivation,
Object target)
Obtains an object's value of the specified additional property. |
protected Boolean |
oclIsKindOf(Object value,
Object typeArg)
Checks whether the supplied value is an instance of the supplied type or one of its super types. |
protected Boolean |
oclIsTypeOf(Object value,
Object typeArg)
Checks whether the supplied object is an instance of the supplied type. |
String |
toString()
|
Object |
visitConstraint(CT 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). |
Object |
visitExpression(OCLExpression<C> expression)
This default implementation simply asks the expression to accept me. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractEvaluationVisitor(Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> env,
EvaluationEnvironment<C,O,P,CLS,E> evalEnv,
Map<? extends CLS,? extends Set<? extends E>> extentMap)
env - the current environmentevalEnv - an evaluation environment (map of variable names to values)extentMap - a map of classes to their instance sets| Method Detail |
|---|
protected final EvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> getVisitor()
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 EvaluationEnvironment<C,O,P,CLS,E> getEvaluationEnvironment()
EvaluationVisitor
getEvaluationEnvironment in interface EvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>public Environment<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E> getEnvironment()
EvaluationVisitor
getEnvironment in interface EvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>protected UMLReflection<PK,C,O,P,EL,PM,S,COA,SSA,CT> getUMLReflection()
public Map<? extends CLS,? extends Set<? extends E>> getExtentMap()
EvaluationVisitor
getExtentMap in interface EvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>protected OCLStandardLibrary<C> getStandardLibrary()
protected final Object getOclInvalid()
protected final C getBoolean()
protected final C getString()
protected final C getInteger()
protected final C getUnlimitedNatural()
protected final C getReal()
protected String getName(Object namedElement)
namedElement - a named element
null if it has nonepublic Object visitExpression(OCLExpression<C> expression)
visitExpression in interface EvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>expression - an OCL expression to evaluate
public Object visitConstraint(CT constraint)
visitExpression(OCLExpression).
visitConstraint in interface EvaluationVisitor<PK,C,O,P,EL,PM,S,COA,SSA,CT,CLS,E>visitConstraint in interface Visitor<Object,C,O,P,EL,PM,S,COA,SSA,CT>visitConstraint in class AbstractVisitor<Object,C,O,P,EL,PM,S,COA,SSA,CT>AbstractVisitor.getSpecification(Object)protected ExpressionInOCL<C,PM> getSpecification(CT constraint)
AbstractVisitor
getSpecification in class AbstractVisitor<Object,C,O,P,EL,PM,S,COA,SSA,CT>constraint - a constraint
AbstractVisitor.visitConstraint(Object)public String toString()
toString in class Objectprotected boolean isUndefined(Object value)
value - a value
protected Object call(O operation,
OCLExpression<C> body,
Object target,
Object[] args)
operation - the operation to invokebody - the operation's body expressiontarget - the object on which to evaluate the operation bodyargs - the arguments to the operation callprotected OCLExpression<C> getOperationBody(O operation)
operation - an operation
protected OCLExpression<C> getPropertyBody(P property)
property - a property
protected Object navigate(P property,
OCLExpression<C> derivation,
Object target)
property - the property to navigatederivation - the expression that computes its valuetarget - the object in which context to evaluate the derivation
protected Boolean oclIsTypeOf(Object value,
Object typeArg)
value - the value to checktypeArg - the type to check
protected Boolean oclIsKindOf(Object value,
Object typeArg)
value - the value to checktypeArg - the type to check
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||