Class RefactoringTool.FieldNameRenamer
- 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.FieldNameRenamer
-
- All Implemented Interfaces:
StateObjectVisitor
- Enclosing class:
- RefactoringTool
protected static class RefactoringTool.FieldNameRenamer extends AbstractTraverseChildrenVisitor
This visitor renames any segment of a path expression.
-
-
Field Summary
Fields Modifier and Type Field Description protected IManagedTypeProvider
managedTypeProvider
The external form of a provider that gives access to the JPA metadata.protected java.lang.String
newFieldName
The new name of the attribute.protected java.lang.String
oldFieldName
The current name of the attribute to rename.protected java.lang.String
typeName
The fully qualified name of the type that got one of its attributes renamed.
-
Constructor Summary
Constructors Constructor Description FieldNameRenamer(IManagedTypeProvider managedTypeProvider, java.lang.String typeName, java.lang.String oldFieldName, java.lang.String newFieldName)
Creates a newAttributeNameRenamer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
rename(AbstractPathExpressionStateObject stateObject)
Performs the rename on the path expression.void
visit(CollectionValuedPathExpressionStateObject stateObject)
Visits the givenCollectionValuedPathExpressionStateObject
.void
visit(StateFieldPathExpressionStateObject stateObject)
Visits the givenStateFieldPathExpressionStateObject
.-
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
-
managedTypeProvider
protected final IManagedTypeProvider managedTypeProvider
The external form of a provider that gives access to the JPA metadata.
-
newFieldName
protected final java.lang.String newFieldName
The new name of the attribute.
-
oldFieldName
protected final java.lang.String oldFieldName
The current name of the attribute to rename.
-
typeName
protected final java.lang.String typeName
The fully qualified name of the type that got one of its attributes renamed.
-
-
Constructor Detail
-
FieldNameRenamer
public FieldNameRenamer(IManagedTypeProvider managedTypeProvider, java.lang.String typeName, java.lang.String oldFieldName, java.lang.String newFieldName)
Creates a newAttributeNameRenamer
.- Parameters:
typeName
- The fully qualified name of the type that got one of its attributes renamedoldFieldName
- The current name of the attribute to renamenewFieldName
- The new name of the attribute
-
-
Method Detail
-
rename
protected void rename(AbstractPathExpressionStateObject stateObject)
Performs the rename on the path expression.- Parameters:
stateObject
- TheAbstractPathExpressionStateObject
being visited, which may have to have its path renamed
-
visit
public void visit(CollectionValuedPathExpressionStateObject stateObject)
Visits the givenCollectionValuedPathExpressionStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheCollectionValuedPathExpressionStateObject
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
-
-