public abstract class JavaExpressionConverter extends JavaExpressionVisitor<JavaExpression,Void>
convert(JavaExpression)
on each subexpression of the JavaExpression
and returns a new JavaExpression
built from the result of calling convert
on each subexpression. (If an expression has no subexpression, then the expression
itself is returned.)
This class makes it easy to implement a subclass that converts subexpressions of a JavaExpression
based on which kind of JavaExpression
the subexpression is. Subclasses
should override the visit method of kinds of JavaExpressions to convert.
Constructor and Description |
---|
JavaExpressionConverter() |
visit
public JavaExpression convert(JavaExpression javaExpr)
javaExpr
and returns the resulting JavaExpression
.javaExpr
- the expression to convertpublic List<JavaExpression> convert(List<JavaExpression> list)
list
and returns the resulting list.list
- the list of expressions to convertprotected JavaExpression visitArrayAccess(ArrayAccess arrayAccessExpr, Void unused)
JavaExpressionVisitor
ArrayAccess
.visitArrayAccess
in class JavaExpressionVisitor<JavaExpression,Void>
arrayAccessExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodarrayAccessExpr
protected JavaExpression visitArrayCreation(ArrayCreation arrayCreationExpr, Void unused)
JavaExpressionVisitor
ArrayCreation
.visitArrayCreation
in class JavaExpressionVisitor<JavaExpression,Void>
arrayCreationExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodarrayCreationExpr
protected JavaExpression visitBinaryOperation(BinaryOperation binaryOpExpr, Void unused)
JavaExpressionVisitor
BinaryOperation
.visitBinaryOperation
in class JavaExpressionVisitor<JavaExpression,Void>
binaryOpExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodbinaryOpExpr
protected JavaExpression visitClassName(ClassName classNameExpr, Void unused)
JavaExpressionVisitor
ClassName
.visitClassName
in class JavaExpressionVisitor<JavaExpression,Void>
classNameExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodclassNameExpr
protected JavaExpression visitFieldAccess(FieldAccess fieldAccessExpr, Void unused)
JavaExpressionVisitor
FieldAccess
.visitFieldAccess
in class JavaExpressionVisitor<JavaExpression,Void>
fieldAccessExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodfieldAccessExpr
protected JavaExpression visitFormalParameter(FormalParameter parameterExpr, Void unused)
JavaExpressionVisitor
FormalParameter
.visitFormalParameter
in class JavaExpressionVisitor<JavaExpression,Void>
parameterExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodparameterExpr
protected JavaExpression visitLocalVariable(LocalVariable localVarExpr, Void unused)
JavaExpressionVisitor
LocalVariable
.visitLocalVariable
in class JavaExpressionVisitor<JavaExpression,Void>
localVarExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodlocalVarExpr
protected JavaExpression visitMethodCall(MethodCall methodCallExpr, Void unused)
JavaExpressionVisitor
MethodCall
.visitMethodCall
in class JavaExpressionVisitor<JavaExpression,Void>
methodCallExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodmethodCallExpr
protected JavaExpression visitThisReference(ThisReference thisExpr, Void unused)
JavaExpressionVisitor
ThisReference
.visitThisReference
in class JavaExpressionVisitor<JavaExpression,Void>
thisExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodthisExpr
protected JavaExpression visitUnaryOperation(UnaryOperation unaryOpExpr, Void unused)
JavaExpressionVisitor
UnaryOperation
.visitUnaryOperation
in class JavaExpressionVisitor<JavaExpression,Void>
unaryOpExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodunaryOpExpr
protected JavaExpression visitUnknown(Unknown unknownExpr, Void unused)
JavaExpressionVisitor
Unknown
.visitUnknown
in class JavaExpressionVisitor<JavaExpression,Void>
unknownExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodunknownExpr
protected JavaExpression visitValueLiteral(ValueLiteral literalExpr, Void unused)
JavaExpressionVisitor
ValueLiteral
.visitValueLiteral
in class JavaExpressionVisitor<JavaExpression,Void>
literalExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit methodliteralExpr