|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ocl.utilities.AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT> org.eclipse.ocl.util.ToStringVisitor<C,O,P,EL,PM,S,COA,SSA,CT>
public class ToStringVisitor<C,O,P,EL,PM,S,COA,SSA,CT>
Converts an OCL expression to a string for debugging. This is not intended to be used by client applications as an AST-to-text transformation.
Field Summary | |
---|---|
protected static String |
NULL_PLACEHOLDER
Indicates where a required element in the AST was null , so
that it is evident in the debugger that something was missing. |
Fields inherited from class org.eclipse.ocl.utilities.AbstractVisitor |
---|
result |
Constructor Summary | |
---|---|
protected |
ToStringVisitor(Environment<?,C,O,P,EL,PM,S,COA,SSA,CT,?,?> env)
Initializes me with my environment. |
Method Summary | ||
---|---|---|
protected List<EObject> |
getConstrainedElements(CT constraint)
|
|
static
|
getInstance(Environment<?,C,O,P,EL,PM,S,COA,SSA,CT,?,?> env)
Obtains an instance of the toString() visitor for the specified environment. |
|
static
|
getInstance(TypedElement<C> element)
Obtains an instance of the toString() visitor for the specified expression or other typed element. |
|
protected String |
getName(Object named)
Null-safe access to the name of a named element. |
|
protected O |
getOperation(COA callOperationAction)
|
|
protected List<PM> |
getParameters(O operation)
|
|
protected String |
getQualifiedName(Object named)
Null-safe access to the qualified name of a named element. |
|
protected C |
getSignal(SSA sendSignalAction)
|
|
protected ExpressionInOCL<C,PM> |
getSpecification(CT constraint)
Overridden by subclasses interested in visiting constraints, to get the constraint's specification. |
|
protected String |
getStereotype(CT constraint)
|
|
protected C |
getType(Object typedElement)
|
|
protected String |
handleAssociationClassCallExp(AssociationClassCallExp<C,P> ac,
String sourceResult,
List<String> qualifierResults)
Callback for an AssociationClassCallExp visit. |
|
protected String |
handleCollectionItem(CollectionItem<C> item,
String itemResult)
Visits the specified collection item with the result of visiting its item expression. |
|
protected String |
handleCollectionLiteralExp(CollectionLiteralExp<C> cl,
List<String> partResults)
Callback for a CollectionLiteralExp visit. |
|
protected String |
handleCollectionRange(CollectionRange<C> range,
String firstResult,
String lastResult)
Visits the specified collection range with the results of visiting its first and last expressions. |
|
protected String |
handleIfExp(IfExp<C> ifExp,
String conditionResult,
String thenResult,
String elseResult)
Callback for an IfExp visit. |
|
protected String |
handleIterateExp(IterateExp<C,PM> callExp,
String sourceResult,
List<String> variableResults,
String resultResult,
String bodyResult)
Callback for an IterateExp visit. |
|
protected String |
handleIteratorExp(IteratorExp<C,PM> callExp,
String sourceResult,
List<String> variableResults,
String bodyResult)
Callback for an IteratorExp visit. |
|
protected String |
handleLetExp(LetExp<C,PM> letExp,
String variableResult,
String inResult)
Callback for LetExp visit. |
|
protected String |
handleMessageExp(MessageExp<C,COA,SSA> messageExp,
String targetResult,
List<String> argumentResults)
Visits the specified message expression with the results of visiting its target and arguments (if any). |
|
protected String |
handleOperationCallExp(OperationCallExp<C,O> oc,
String sourceResult,
List<String> argumentResults)
Callback for an OperationCallExp visit. |
|
protected String |
handlePropertyCallExp(PropertyCallExp<C,P> pc,
String sourceResult,
List<String> qualifierResults)
Callback for an AssociationEndCallExp visit. |
|
protected String |
handleTupleLiteralExp(TupleLiteralExp<C,P> literalExp,
List<String> partResults)
Callback for a TupleLiteralExp visit. |
|
protected String |
handleTupleLiteralPart(TupleLiteralPart<C,P> part,
String valueResult)
Visits the specified tuple literal part with the results of visiting its value (if any). |
|
protected String |
handleVariable(Variable<C,PM> vd,
String initResult)
Callback for the Variable visit. |
|
protected String |
initialLower(String name)
|
|
protected boolean |
isClassifier(Object element)
|
|
protected boolean |
isOperation(Object element)
|
|
protected boolean |
isProperty(Object element)
|
|
String |
visitBooleanLiteralExp(BooleanLiteralExp<C> bl)
Callback for a BooleanLiteralExp visit. |
|
String |
visitConstraint(CT constraint)
Renders a constraint with its context and expression. |
|
String |
visitEnumLiteralExp(EnumLiteralExp<C,EL> el)
Callback for an EnumLiteralExp visit. |
|
String |
visitExpressionInOCL(ExpressionInOCL<C,PM> expression)
Renders an ExpressionInOcl with its context variables and body. |
|
String |
visitIntegerLiteralExp(IntegerLiteralExp<C> il)
Callback for an IntegerLiteralExp visit. |
|
String |
visitInvalidLiteralExp(InvalidLiteralExp<C> il)
Simply returns AbstractVisitor.result . |
|
String |
visitNullLiteralExp(NullLiteralExp<C> il)
Simply returns AbstractVisitor.result . |
|
String |
visitRealLiteralExp(RealLiteralExp<C> rl)
Callback for a RealLiteralExp visit. |
|
String |
visitStateExp(StateExp<C,S> s)
Simply returns AbstractVisitor.result . |
|
String |
visitStringLiteralExp(StringLiteralExp<C> sl)
Callback for a StringLiteralExp visit. |
|
String |
visitTypeExp(TypeExp<C> t)
Simply returns AbstractVisitor.result . |
|
String |
visitUnlimitedNaturalLiteralExp(UnlimitedNaturalLiteralExp<C> unl)
Callback for an UnlimitedNaturalLiteralExp visit. |
|
String |
visitUnspecifiedValueExp(UnspecifiedValueExp<C> uv)
Callback for an UnspecifiedValueExp visit. |
|
String |
visitVariableExp(VariableExp<C,PM> v)
Callback for a VariableExp visit. |
Methods inherited from class org.eclipse.ocl.utilities.AbstractVisitor |
---|
handleConstraint, handleExpressionInOCL, safeVisit, visitAssociationClassCallExp, visitCollectionItem, visitCollectionLiteralExp, visitCollectionRange, visitIfExp, visitIterateExp, visitIteratorExp, visitLetExp, visitMessageExp, visitOperationCallExp, visitPropertyCallExp, visitTupleLiteralExp, visitTupleLiteralPart, visitVariable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static String NULL_PLACEHOLDER
null
, so
that it is evident in the debugger that something was missing. We don't
want just "null"
because that would look like the OclVoid
literal.
Constructor Detail |
---|
protected ToStringVisitor(Environment<?,C,O,P,EL,PM,S,COA,SSA,CT,?,?> env)
env
- my environmentMethod Detail |
---|
public static <C,O,P,EL,PM,S,COA,SSA,CT> ToStringVisitor<C,O,P,EL,PM,S,COA,SSA,CT> getInstance(Environment<?,C,O,P,EL,PM,S,COA,SSA,CT,?,?> env)
env
- an OCL environment
public static <C,O,P,EL,PM,S,COA,SSA,CT> ToStringVisitor<C,O,P,EL,PM,S,COA,SSA,CT> getInstance(TypedElement<C> element)
element
- an OCL expression or other typed element such as a variable
protected String getName(Object named)
named
- a named element or null
null
. i.e., null
is never returnedprotected String getQualifiedName(Object named)
named
- a named element or null
null
. i.e., null
is never
returnedprotected String handleOperationCallExp(OperationCallExp<C,O> oc, String sourceResult, List<String> argumentResults)
handleOperationCallExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
oc
- the operation call expressionsourceResult
- the result of visiting the expression's sourceargumentResults
- the results of visiting the expression's
arguments, or an empty list if there are no arguments
AbstractVisitor.visitOperationCallExp(OperationCallExp)
public String visitEnumLiteralExp(EnumLiteralExp<C,EL> el)
visitEnumLiteralExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitEnumLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
el
- the enumeration literal expresion
public String visitVariableExp(VariableExp<C,PM> v)
visitVariableExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitVariableExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
v
- the variable expression
protected String handlePropertyCallExp(PropertyCallExp<C,P> pc, String sourceResult, List<String> qualifierResults)
handlePropertyCallExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
pc
- the property call expressionsourceResult
- the result of visiting the expression's sourcequalifierResults
- the results of visiting the expression's
qualifiers, or an empty list if there are no qualifiers
AbstractVisitor.visitPropertyCallExp(PropertyCallExp)
protected String handleAssociationClassCallExp(AssociationClassCallExp<C,P> ac, String sourceResult, List<String> qualifierResults)
handleAssociationClassCallExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
ac
- the association class expressionsourceResult
- the result of visiting the expression's sourcequalifierResults
- the results of visiting the expression's
qualifiers, or an empty list if there are no qualifiers
AbstractVisitor.visitAssociationClassCallExp(AssociationClassCallExp)
protected String initialLower(String name)
protected String handleVariable(Variable<C,PM> vd, String initResult)
handleVariable
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
vd
- the variable declarationinitResult
- the result of visiting the expression's initializer,
or null
if it has none
AbstractVisitor.visitVariable(Variable)
protected String handleIfExp(IfExp<C> ifExp, String conditionResult, String thenResult, String elseResult)
handleIfExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
ifExp
- an IfExpconditionResult
- the result of visiting the expression's conditionthenResult
- the result of visiting the expression's thenelseResult
- the result of visiting the expression's else
AbstractVisitor.visitIfExp(IfExp)
public String visitTypeExp(TypeExp<C> t)
AbstractVisitor
AbstractVisitor.result
.
visitTypeExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitTypeExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
public String visitStateExp(StateExp<C,S> s)
AbstractVisitor
AbstractVisitor.result
.
visitStateExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitStateExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
public String visitUnspecifiedValueExp(UnspecifiedValueExp<C> uv)
visitUnspecifiedValueExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitUnspecifiedValueExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
uv
- - UnspecifiedValueExp
public String visitIntegerLiteralExp(IntegerLiteralExp<C> il)
visitIntegerLiteralExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitIntegerLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
il
- -- integer literal expression
public String visitUnlimitedNaturalLiteralExp(UnlimitedNaturalLiteralExp<C> unl)
visitUnlimitedNaturalLiteralExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitUnlimitedNaturalLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
unl
- -- unlimited natural literal expression
public String visitRealLiteralExp(RealLiteralExp<C> rl)
visitRealLiteralExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitRealLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
rl
- -- real literal expression
public String visitStringLiteralExp(StringLiteralExp<C> sl)
visitStringLiteralExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitStringLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
sl
- -- string literal expression
public String visitBooleanLiteralExp(BooleanLiteralExp<C> bl)
visitBooleanLiteralExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitBooleanLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
bl
- -- boolean literal expression
protected String handleLetExp(LetExp<C,PM> letExp, String variableResult, String inResult)
handleLetExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
letExp
- a let expressionvariableResult
- the result of visiting the expression's variableinResult
- the result of visiting the expression's in expression
AbstractVisitor.visitLetExp(LetExp)
protected String handleIterateExp(IterateExp<C,PM> callExp, String sourceResult, List<String> variableResults, String resultResult, String bodyResult)
handleIterateExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
callExp
- an iterate expressionsourceResult
- the result of visiting the expression's sourcevariableResults
- the results of visiting the expression's
iterator variablesresultResult
- the result of visiting the expressions' result variablebodyResult
- the result of visiting the expression's body
AbstractVisitor.visitIterateExp(IterateExp)
protected String handleIteratorExp(IteratorExp<C,PM> callExp, String sourceResult, List<String> variableResults, String bodyResult)
handleIteratorExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
callExp
- an iterator expressionsourceResult
- the result of visiting the expression's sourcevariableResults
- the results of visiting the expression's
iterator variablesbodyResult
- the result of visiting the expression's body
AbstractVisitor.visitIteratorExp(IteratorExp)
protected String handleCollectionLiteralExp(CollectionLiteralExp<C> cl, List<String> partResults)
handleCollectionLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
cl
- collection literal expressionpartResults
- the results of visiting the expression's
parts, or an empty list if there are no parts
AbstractVisitor.visitCollectionLiteralExp(CollectionLiteralExp)
protected String handleCollectionItem(CollectionItem<C> item, String itemResult)
AbstractVisitor
handleCollectionItem
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
item
- the collection itemitemResult
- the result of visiting the item's item expression
AbstractVisitor.result
, by defaultAbstractVisitor.visitCollectionItem(CollectionItem)
protected String handleCollectionRange(CollectionRange<C> range, String firstResult, String lastResult)
AbstractVisitor
handleCollectionRange
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
range
- the collection rangefirstResult
- the result of visiting the range's first expressionlastResult
- the result of visiting the range's last expression
AbstractVisitor.result
, by defaultAbstractVisitor.visitCollectionRange(CollectionRange)
protected String handleTupleLiteralExp(TupleLiteralExp<C,P> literalExp, List<String> partResults)
handleTupleLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
literalExp
- tuple literal expressionpartResults
- the results of visiting the expression's
parts, or an empty list if there are no parts
AbstractVisitor.visitTupleLiteralExp(TupleLiteralExp)
protected String handleTupleLiteralPart(TupleLiteralPart<C,P> part, String valueResult)
AbstractVisitor
handleTupleLiteralPart
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
part
- the tuple literal partvalueResult
- the result of visiting the expression's value, or
null
if it has no value
AbstractVisitor.result
, by defaultAbstractVisitor.visitTupleLiteralPart(TupleLiteralPart)
protected String handleMessageExp(MessageExp<C,COA,SSA> messageExp, String targetResult, List<String> argumentResults)
AbstractVisitor
handleMessageExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
messageExp
- the message expressiontargetResult
- the result of visiting the expression's targetargumentResults
- the results of visiting the expression's
arguments, or an empty list if there are no arguments
AbstractVisitor.result
, by defaultAbstractVisitor.visitMessageExp(MessageExp)
protected O getOperation(COA callOperationAction)
protected C getSignal(SSA sendSignalAction)
public String visitExpressionInOCL(ExpressionInOCL<C,PM> expression)
visitExpressionInOCL
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitExpressionInOCL
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
public String visitConstraint(CT constraint)
visitConstraint
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitConstraint
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
AbstractVisitor.getSpecification(Object)
protected boolean isClassifier(Object element)
protected boolean isOperation(Object element)
protected boolean isProperty(Object element)
protected List<EObject> getConstrainedElements(CT constraint)
protected String getStereotype(CT constraint)
protected ExpressionInOCL<C,PM> getSpecification(CT constraint)
AbstractVisitor
getSpecification
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
constraint
- a constraint
AbstractVisitor.visitConstraint(Object)
protected C getType(Object typedElement)
protected List<PM> getParameters(O operation)
public String visitInvalidLiteralExp(InvalidLiteralExp<C> il)
AbstractVisitor
AbstractVisitor.result
.
visitInvalidLiteralExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitInvalidLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
public String visitNullLiteralExp(NullLiteralExp<C> il)
AbstractVisitor
AbstractVisitor.result
.
visitNullLiteralExp
in interface Visitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
visitNullLiteralExp
in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
|
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 |