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
protected static class RefactoringTool.ClassNameRenamer extends AbstractTraverseChildrenVisitor
This visitor renames a fully qualified class name.
-
-
Field Summary
Fields Modifier and Type Field Description protected RefactoringTool.StateObjectUpdater<ConstructorExpressionStateObject>
constructorUpdater
TheRefactoringTool.StateObjectUpdater
that updates the class name when notified.protected java.lang.String
newClassName
The current name of the class to rename.protected java.lang.String
oldClassName
The new name of the class.protected RefactoringTool.StateObjectUpdater<StateFieldPathExpressionStateObject>
pathExpressionUpdater
TheRefactoringTool.StateObjectUpdater
that updates the state field path expression when notified.
-
Constructor Summary
Constructors Constructor Description ClassNameRenamer(java.lang.String oldClassName, java.lang.String newClassName)
Creates a newClassNameRenamer
.
-
Method Summary
-
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 Detail
-
constructorUpdater
protected RefactoringTool.StateObjectUpdater<ConstructorExpressionStateObject> constructorUpdater
TheRefactoringTool.StateObjectUpdater
that updates the class name when notified.
-
newClassName
protected final java.lang.String newClassName
The current name of the class to rename.
-
oldClassName
protected final java.lang.String oldClassName
The new name of the class.
-
pathExpressionUpdater
protected RefactoringTool.StateObjectUpdater<StateFieldPathExpressionStateObject> pathExpressionUpdater
TheRefactoringTool.StateObjectUpdater
that updates the state field path expression when notified.
-
-
Method Detail
-
buildConstructorUpdater
protected RefactoringTool.StateObjectUpdater<ConstructorExpressionStateObject> buildConstructorUpdater()
-
buildPathExpressionStateObjectUpdater
protected RefactoringTool.StateObjectUpdater<StateFieldPathExpressionStateObject> buildPathExpressionStateObjectUpdater()
-
constructorUpdater
protected RefactoringTool.StateObjectUpdater<ConstructorExpressionStateObject> constructorUpdater()
-
pathExpressionUpdater
protected RefactoringTool.StateObjectUpdater<StateFieldPathExpressionStateObject> pathExpressionUpdater()
-
visit
public void visit(ConstructorExpressionStateObject stateObject)
Visits the givenConstructorExpressionStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheConstructorExpressionStateObject
to visit
-
visit
public void visit(StateFieldPathExpressionStateObject stateObject)
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, java.lang.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
-
-