public class ToStringVisitor<C,O,P,EL,PM,S,COA,SSA,CT> extends AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>
| Modifier and Type | Field and Description |
|---|---|
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. |
result| Modifier | Constructor and Description |
|---|---|
protected |
ToStringVisitor(Environment<?,C,O,P,EL,PM,S,COA,SSA,CT,?,?> env)
Initializes me with my environment.
|
| Modifier and Type | Method and Description |
|---|---|
protected List<? extends EObject> |
getConstrainedElements(CT constraint) |
static <C,O,P,EL,PM,S,COA,SSA,CT> |
getInstance(Environment<?,C,O,P,EL,PM,S,COA,SSA,CT,?,?> env)
Obtains an instance of the toString() visitor for the specified
environment.
|
static <C,O,P,EL,PM,S,COA,SSA,CT> |
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) |
protected String |
maybeAtPre(FeatureCallExp<C> mpc,
String base) |
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.
|
handleConstraint, handleExpressionInOCL, safeVisit, visitAssociationClassCallExp, visitCollectionItem, visitCollectionLiteralExp, visitCollectionRange, visitIfExp, visitIterateExp, visitIteratorExp, visitLetExp, visitMessageExp, visitOperationCallExp, visitPropertyCallExp, visitTupleLiteralExp, visitTupleLiteralPart, visitVariableprotected 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.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 environmentpublic 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 variableprotected String getName(Object named)
named - a named element or nullnull. i.e., null is never returnedprotected String getQualifiedName(Object named)
named - a named element or nullnull. 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 argumentsAbstractVisitor.visitOperationCallExp(OperationCallExp)public String visitEnumLiteralExp(EnumLiteralExp<C,EL> el)
public String visitVariableExp(VariableExp<C,PM> v)
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 qualifiersAbstractVisitor.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 qualifiersAbstractVisitor.visitAssociationClassCallExp(AssociationClassCallExp)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 noneAbstractVisitor.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 elseAbstractVisitor.visitIfExp(IfExp)public String visitTypeExp(TypeExp<C> t)
AbstractVisitorAbstractVisitor.result.public String visitStateExp(StateExp<C,S> s)
AbstractVisitorAbstractVisitor.result.public String visitUnspecifiedValueExp(UnspecifiedValueExp<C> uv)
public String visitIntegerLiteralExp(IntegerLiteralExp<C> il)
public String visitUnlimitedNaturalLiteralExp(UnlimitedNaturalLiteralExp<C> unl)
public String visitRealLiteralExp(RealLiteralExp<C> rl)
public String visitStringLiteralExp(StringLiteralExp<C> sl)
public String visitBooleanLiteralExp(BooleanLiteralExp<C> bl)
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 expressionAbstractVisitor.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 bodyAbstractVisitor.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 bodyAbstractVisitor.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 partsAbstractVisitor.visitCollectionLiteralExp(CollectionLiteralExp)protected String handleCollectionItem(CollectionItem<C> item, String itemResult)
AbstractVisitorhandleCollectionItem 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 expressionAbstractVisitor.result, by defaultAbstractVisitor.visitCollectionItem(CollectionItem)protected String handleCollectionRange(CollectionRange<C> range, String firstResult, String lastResult)
AbstractVisitorhandleCollectionRange 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 expressionAbstractVisitor.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 partsAbstractVisitor.visitTupleLiteralExp(TupleLiteralExp)protected String handleTupleLiteralPart(TupleLiteralPart<C,P> part, String valueResult)
AbstractVisitorhandleTupleLiteralPart 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 valueAbstractVisitor.result, by defaultAbstractVisitor.visitTupleLiteralPart(TupleLiteralPart)protected String handleMessageExp(MessageExp<C,COA,SSA> messageExp, String targetResult, List<String> argumentResults)
AbstractVisitorhandleMessageExp 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 argumentsAbstractVisitor.result, by defaultAbstractVisitor.visitMessageExp(MessageExp)public String visitExpressionInOCL(ExpressionInOCL<C,PM> expression)
public String visitConstraint(CT constraint)
protected boolean isClassifier(Object element)
protected boolean isOperation(Object element)
protected boolean isProperty(Object element)
protected ExpressionInOCL<C,PM> getSpecification(CT constraint)
AbstractVisitorgetSpecification in class AbstractVisitor<String,C,O,P,EL,PM,S,COA,SSA,CT>constraint - a constraintAbstractVisitor.visitConstraint(Object)protected String maybeAtPre(FeatureCallExp<C> mpc, String base)
public String visitInvalidLiteralExp(InvalidLiteralExp<C> il)
AbstractVisitorAbstractVisitor.result.public String visitNullLiteralExp(NullLiteralExp<C> il)
AbstractVisitorAbstractVisitor.result.Copyright © 2015 Open eHealth Foundation. All rights reserved.