Class BasicRefactoringTool.AttributeNameRenamer
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.AttributeNameRenamer
- All Implemented Interfaces:
ExpressionVisitor
- Enclosing class:
BasicRefactoringTool
protected class BasicRefactoringTool.AttributeNameRenamer
extends BasicRefactoringTool.AbstractRenamer
This visitor renames any segment of a path expression.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe new name of the attribute.protected final StringThe current name of the attribute to rename.protected final StringThe fully qualified name of the type that got one of its attributes renamed.Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.AbstractRenamer
textEdits -
Constructor Summary
ConstructorsConstructorDescriptionAttributeNameRenamer(JPQLQueryContext queryContext, String typeName, String oldAttributeName, String newAttributeName) Creates a newAttributeNameRenamer. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidrename(AbstractPathExpression expression) Performs the rename on the path expression.voidvisit(CollectionValuedPathExpression expression) Visits theCollectionValuedPathExpressionexpression.voidvisit(StateFieldPathExpression expression) Visits theStateFieldPathExpressionexpression.Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.AbstractRenamer
addTextEdit, addTextEdit, buildTextEdit, repositionMethods inherited from class org.eclipse.persistence.jpa.jpql.parser.AbstractTraverseChildrenVisitor
visitMethods 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, visit
-
Field Details
-
newAttributeName
The new name of the attribute. -
oldAttributeName
The current name of the attribute to rename. -
typeName
The fully qualified name of the type that got one of its attributes renamed.
-
-
Constructor Details
-
AttributeNameRenamer
public AttributeNameRenamer(JPQLQueryContext queryContext, String typeName, String oldAttributeName, String newAttributeName) Creates a newAttributeNameRenamer.- Parameters:
queryContext- The context used to query information about the JPQL querytypeName- The fully qualified name of the type that got one of its attributes renamedoldAttributeName- The current name of the attribute to renamenewAttributeName- The new name of the attribute
-
-
Method Details
-
rename
Performs the rename on the path expression.- Parameters:
expression- TheAbstractPathExpressionbeing visited, which may have to have its path renamed
-
visit
Description copied from interface:ExpressionVisitorVisits theCollectionValuedPathExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-
visit
Description copied from interface:ExpressionVisitorVisits theStateFieldPathExpressionexpression.- Specified by:
visitin interfaceExpressionVisitor- Overrides:
visitin classAnonymousExpressionVisitor- Parameters:
expression- TheExpressionto visit
-