Class RefactoringTool.ClassNameRenamer
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.model.query.AnonymousStateObjectVisitor
org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTraverseChildrenVisitor
org.eclipse.persistence.jpa.jpql.tools.RefactoringTool.ClassNameRenamer
- All Implemented Interfaces:
StateObjectVisitor
- Enclosing class:
RefactoringTool
This visitor renames a fully qualified class name.
-
Field Summary
Modifier and TypeFieldDescriptionTheRefactoringTool.StateObjectUpdater
that updates the class name when notified.protected final String
The current name of the class to rename.protected final String
The new name of the class.TheRefactoringTool.StateObjectUpdater
that updates the state field path expression when notified. -
Constructor Summary
ConstructorDescriptionClassNameRenamer
(String oldClassName, String newClassName) Creates a newClassNameRenamer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
visit
(ConstructorExpressionStateObject stateObject) Visits the givenConstructorExpressionStateObject
.void
visit
(StateFieldPathExpressionStateObject stateObject) Visits the givenStateFieldPathExpressionStateObject
.protected <T extends StateObject>
voidvisit
(T stateObject, String value, RefactoringTool.StateObjectUpdater<T> updater) Visits the givenStateObject
and if its value is the same as the old class name or if the value represents an inner class of that old class name, then the givenRefactoringTool.StateObjectUpdater
will be notified to replace the value.Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTraverseChildrenVisitor
visit
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AnonymousStateObjectVisitor
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
-
constructorUpdater
TheRefactoringTool.StateObjectUpdater
that updates the class name when notified. -
newClassName
The current name of the class to rename. -
oldClassName
The new name of the class. -
pathExpressionUpdater
protected RefactoringTool.StateObjectUpdater<StateFieldPathExpressionStateObject> pathExpressionUpdaterTheRefactoringTool.StateObjectUpdater
that updates the state field path expression when notified.
-
-
Constructor Details
-
ClassNameRenamer
Creates a newClassNameRenamer
.- Parameters:
oldClassName
- The current name of the class to renamenewClassName
- The new name of the class
-
-
Method Details
-
buildConstructorUpdater
protected RefactoringTool.StateObjectUpdater<ConstructorExpressionStateObject> buildConstructorUpdater() -
buildPathExpressionStateObjectUpdater
protected RefactoringTool.StateObjectUpdater<StateFieldPathExpressionStateObject> buildPathExpressionStateObjectUpdater() -
constructorUpdater
-
pathExpressionUpdater
protected RefactoringTool.StateObjectUpdater<StateFieldPathExpressionStateObject> pathExpressionUpdater() -
visit
Description copied from interface:StateObjectVisitor
Visits the givenConstructorExpressionStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheConstructorExpressionStateObject
to visit
-
visit
Description copied from interface:StateObjectVisitor
Visits the givenStateFieldPathExpressionStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheStateFieldPathExpressionStateObject
to visit
-
visit
protected <T extends StateObject> void visit(T stateObject, String value, RefactoringTool.StateObjectUpdater<T> updater) Visits the givenStateObject
and if its value is the same as the old class name or if the value represents an inner class of that old class name, then the givenRefactoringTool.StateObjectUpdater
will be notified to replace the value.- Parameters:
stateObject
- TheStateObject
that is being visitedvalue
- The value to check if it's the old class nameupdater
- TheRefactoringTool.StateObjectUpdater
is notified when to replace the value
-