Class JavaRewriterMerger

java.lang.Object
com.vaadin.copilot.javarewriter.JavaRewriterMerger

public class JavaRewriterMerger extends Object
Handles merging of the original source file with changes perform to the AST. Outputs the original parts of the source file as they were and tries it best to make the new changes fit in.
  • Constructor Details

    • JavaRewriterMerger

      public JavaRewriterMerger()
  • Method Details

    • apply

      public static String apply(Set<com.github.javaparser.ast.Node> addedOrModifiedNodes, Set<com.github.javaparser.Range> removedRanges, String source)
      Applies the given changes to the given source and returns the result.
      Parameters:
      addedOrModifiedNodes - the nodes that have been added or modified and need to be written to the file
      removedRanges - the ranges that have been removed from the original source
      source - the original source