Class DefaultRefactoringDelta

    • Constructor Detail

      • DefaultRefactoringDelta

        public DefaultRefactoringDelta​(CharSequence jpqlQuery)
        Creates a new DefaultRefactoringDelta.
        Parameters:
        jpqlQuery - The JPQL query or JPQL fragment that will be traversed when refactoring operations will be executed
        Throws:
        NullPointerException - The JPQL query cannot be null
    • Method Detail

      • addTextEdit

        public void addTextEdit​(TextEdit textEdit)
        Adds the given TextEdit at the right position. The list will be kept ordered, meaning the insertion index is based on the offset, from the biggest value to the smallest value.
        Parameters:
        textEdit - The TextEdit to add
        Throws:
        NullPointerException - The TextEdit cannot be null
      • addTextEdits

        public void addTextEdits​(Iterable<? extends TextEdit> textEdits)
        Adds the given collection of TextEdit objects. The list will be kept ordered, meaning the insertion index is based on the offset, from the biggest value to the smallest value.
        Parameters:
        textEdits - The collection of TextEdit objects to add
        Throws:
        NullPointerException - The given Iterable or one of the child TextEdit was null
      • calculateInsertionPosition

        protected int calculateInsertionPosition​(TextEdit textEdit)
        Calculates the insertion position for the given TextEdit based on those already registered
        Parameters:
        textEdit - The TextEdit for which its insertion position will be calculated
        Returns:
        The insertion position for the given TextEdit
      • initialize

        protected void initialize​(CharSequence jpqlQuery)
        Initializes this DefaultRefactoringDelta.
        Parameters:
        jpqlQuery - The JPQL query or JPQL fragment that will be traversed when refactoring operations will be executed
        Throws:
        NullPointerException - The JPQL query cannot be null
      • textEdits

        public ListIterable<TextEdit> textEdits()
        Description copied from interface: RefactoringDelta
        Returns the collection of TextEdit objects that have been added during one or several refactoring operations. The collection has been ordered where the TextEdit's offset are in reverse order, i.e. from the biggest to the smallest values.
        Specified by:
        textEdits in interface RefactoringDelta
        Returns:
        The ordered collection of TextEdit objects