Class DescriptionBasedDiff

All Implemented Interfaces:
Diff, DescriptionListener

public final class DescriptionBasedDiff extends Object implements DescriptionListener, Diff
Implementation of a Diff that performs the modifications that are passed to its onDescribed( method, with no formatting.

If imports are changed, they are resorted as per Google Java style.

Author: (Louis Wasserman)
  • Method Details

    • create

      public static DescriptionBasedDiff create( compilationUnit, ImportOrganizer importOrganizer)
    • createIgnoringOverlaps

      public static DescriptionBasedDiff createIgnoringOverlaps( compilationUnit, ImportOrganizer importOrganizer)
    • getRelevantFileName

      public String getRelevantFileName()
      Description copied from interface: Diff
      Gets the name of the file this difference applies to
      Specified by:
      getRelevantFileName in interface Diff
    • isEmpty

      public boolean isEmpty()
    • onDescribed

      public void onDescribed(Description description)
      Description copied from interface: DescriptionListener
      Reports a suggested modification to the code.
      Specified by:
      onDescribed in interface DescriptionListener
    • handleFix

      public void handleFix(Fix fix)
    • applyDifferences

      public void applyDifferences(SourceFile sourceFile)
      Description copied from interface: Diff
      Applies this difference to the supplied sourceFile.
      Specified by:
      applyDifferences in interface Diff