java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.DefaultTextEdit
All Implemented Interfaces:
TextEdit

public class DefaultTextEdit extends Object implements TextEdit
The default implementation of a TextEdit, which contains the location of the change within the JPQL query (offset) and the old and new values.
Since:
2.4
Version:
2.4
  • Constructor Details

    • DefaultTextEdit

      public DefaultTextEdit(int offset, String oldValue, String newValue)
      Creates a new DefaultTextEdit.
      Parameters:
      offset - The location of the old value within the text
      oldValue - the value that was found within the text that should be replaced by the new value
      newValue - The new value that should replace the old value
  • Method Details

    • getLength

      public int getLength()
      Description copied from interface: TextEdit
      Returns the length of the text to replace with the new value.
      Specified by:
      getLength in interface TextEdit
      Returns:
      The old value's length
    • getNewValue

      public String getNewValue()
      Description copied from interface: TextEdit
      Returns the new value that should replace the old value.
      Specified by:
      getNewValue in interface TextEdit
      Returns:
      The value to replace the old value
    • getOffset

      public int getOffset()
      Description copied from interface: TextEdit
      Returns the location of the old value within the text.
      Specified by:
      getOffset in interface TextEdit
      Returns:
      The location of the old value within the text
    • getOldValue

      public String getOldValue()
      Description copied from interface: TextEdit
      Returns the value that was found within the text that should be replaced by the new value.
      Specified by:
      getOldValue in interface TextEdit
      Returns:
      The value to replace
    • toString

      public String toString()
      Overrides:
      toString in class Object