Class BasicRefactoringTool.ResultVariableNameRenamer
java.lang.Object
org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
org.eclipse.persistence.jpa.jpql.parser.AbstractTraverseChildrenVisitor
org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.AbstractRenamer
org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.ResultVariableNameRenamer
- All Implemented Interfaces:
ExpressionVisitor
- Enclosing class:
BasicRefactoringTool
protected class BasicRefactoringTool.ResultVariableNameRenamer
extends BasicRefactoringTool.AbstractRenamer
This visitor renames all the result variables found in the JPQL query.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
The new name of the result variable.protected final String
The current result variable name.protected boolean
Makes sure an identification variable is renamed only when it's used by an order by item.Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.AbstractRenamer
textEdits
-
Constructor Summary
ConstructorDescriptionResultVariableNameRenamer
(String oldVariableName, String newVariableName) Creates a newResultVariableNameRenamer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
visit
(IdentificationVariable expression) Visits theIdentificationVariable
expression.void
visit
(ResultVariable expression) Visits theResultVariable
expression.void
visit
(SelectStatement expression) Visits theSelectStatement
expression.Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.AbstractRenamer
addTextEdit, addTextEdit, buildTextEdit, reposition
Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AbstractTraverseChildrenVisitor
visit
Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Field Details
-
newVariableName
The new name of the result variable. -
oldVariableName
The current result variable name. -
renameIdentificationVariable
protected boolean renameIdentificationVariableMakes sure an identification variable is renamed only when it's used by an order by item.
-
-
Constructor Details
-
ResultVariableNameRenamer
Creates a newResultVariableNameRenamer
.- Parameters:
oldVariableName
- The current result variable namenewVariableName
- The new name of the result variable
-
-
Method Details
-
visit
Description copied from interface:ExpressionVisitor
Visits theIdentificationVariable
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theResultVariable
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theSelectStatement
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-