EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql
Class BasicRefactoringTool.AbstractRenamer

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
      extended by org.eclipse.persistence.jpa.jpql.parser.AbstractTraverseChildrenVisitor
          extended by org.eclipse.persistence.jpa.jpql.BasicRefactoringTool.AbstractRenamer
All Implemented Interfaces:
ExpressionVisitor
Direct Known Subclasses:
BasicRefactoringTool.ClassNameRenamer, BasicRefactoringTool.EntityNameRenamer, BasicRefactoringTool.EnumConstantRenamer, BasicRefactoringTool.FieldNameRenamer, BasicRefactoringTool.ResultVariableNameRenamer, BasicRefactoringTool.VariableNameRenamer
Enclosing class:
BasicRefactoringTool

protected abstract class BasicRefactoringTool.AbstractRenamer
extends AbstractTraverseChildrenVisitor

The abstract class that all refactoring classes should extend, it automatically provides the MultiTextEdit that will holds the TextEdit objects that are related to the same refactoring event.


Field Summary
protected  java.util.List<TextEdit> textEdits
          The list of TextEdit objects that were created for each refactoring operation.
 
Constructor Summary
protected BasicRefactoringTool.AbstractRenamer()
          Creates a new AbstractRenamer.
 
Method Summary
protected  void addTextEdit(Expression expression, int extraOffset, java.lang.String oldValue, java.lang.String newValue)
          Adds a new TextEdit with the given information.
protected  void addTextEdit(Expression expression, java.lang.String oldValue, java.lang.String newValue)
          Adds a new TextEdit with the given information.
protected  TextEdit buildTextEdit(int offset, java.lang.String oldValue, java.lang.String newValue)
          Creates a new TextEdit for the given refactoring information.
protected  int reposition(int offset)
          Repositions the given position that is based on the generated JPQL query to be the position from the JPQL fragment that was parsed.
 
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, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textEdits

protected java.util.List<TextEdit> textEdits
The list of TextEdit objects that were created for each refactoring operation.

Constructor Detail

BasicRefactoringTool.AbstractRenamer

protected BasicRefactoringTool.AbstractRenamer()
Creates a new AbstractRenamer.

Method Detail

addTextEdit

protected void addTextEdit(Expression expression,
                           int extraOffset,
                           java.lang.String oldValue,
                           java.lang.String newValue)
Adds a new TextEdit with the given information.

Parameters:
expression - The Expression which should be refactored, it will be used to retrieve the offset of the change
extraOffset - Additional offset that will be added to the given Expression's offset, which is the length of the string representation of what is before it
oldValue - The old value to change to the new one
newValue - The new value

addTextEdit

protected void addTextEdit(Expression expression,
                           java.lang.String oldValue,
                           java.lang.String newValue)
Adds a new TextEdit with the given information.

Parameters:
expression - The Expression which should be refactored, it will be used to retrieve the offset of the change
oldValue - The old value to change to the new one
newValue - The new value

buildTextEdit

protected TextEdit buildTextEdit(int offset,
                                 java.lang.String oldValue,
                                 java.lang.String newValue)
Creates a new TextEdit for the given refactoring information.

Parameters:
offset - The position where the change should be made within the actual JPQL fragment
oldValue - The old value to change to the new one
newValue - The new value
Returns:
A new TextEdit

reposition

protected int reposition(int offset)
Repositions the given position that is based on the generated JPQL query to be the position from the JPQL fragment that was parsed.

Parameters:
offset - The position within the string generated by Expression.toActualText()
Returns:
The position within the JPQL fragment that was passed to the refactoring tool

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference