Class 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
    Author:
    Pascal Filion
    • Constructor Detail

      • 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 Detail

      • getLength

        public int getLength()
        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()
        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()
        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()
        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