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
Fields Modifier and Type Field Description protected java.lang.String
newVariableName
The new name of the result variable.protected java.lang.String
oldVariableName
The current result variable name.protected boolean
renameIdentificationVariable
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
Constructors Constructor Description ResultVariableNameRenamer(java.lang.String oldVariableName, java.lang.String newVariableName)
Creates a newResultVariableNameRenamer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
-
-
-
-
Field Detail
-
newVariableName
protected final java.lang.String newVariableName
The new name of the result variable.
-
oldVariableName
protected final java.lang.String oldVariableName
The current result variable name.
-
renameIdentificationVariable
protected boolean renameIdentificationVariable
Makes sure an identification variable is renamed only when it's used by an order by item.
-
-
Constructor Detail
-
ResultVariableNameRenamer
public ResultVariableNameRenamer(java.lang.String oldVariableName, java.lang.String newVariableName)
Creates a newResultVariableNameRenamer
.- Parameters:
oldVariableName
- The current result variable namenewVariableName
- The new name of the result variable
-
-
Method Detail
-
visit
public void visit(IdentificationVariable expression)
Visits theIdentificationVariable
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(ResultVariable expression)
Visits theResultVariable
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
public void visit(SelectStatement expression)
Visits theSelectStatement
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
-