public final class DescriptionBasedDiff extends Object implements DescriptionListener, Diff
Diff
that performs the modifications that are passed to its onDescribed(com.google.errorprone.matchers.Description)
method, with no formatting.
If imports are changed, they are resorted as per Google Java style.
DescriptionListener.Factory
Modifier and Type | Method and Description |
---|---|
void |
applyDifferences(SourceFile sourceFile)
Applies this difference to the supplied
sourceFile . |
static DescriptionBasedDiff |
create(com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit,
ImportOrganizer importOrganizer) |
static DescriptionBasedDiff |
createIgnoringOverlaps(com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit,
ImportOrganizer importOrganizer) |
String |
getRelevantFileName()
Gets the name of the file this difference applies to
|
void |
handleFix(Fix fix) |
boolean |
isEmpty() |
void |
onDescribed(Description description)
Reports a suggested modification to the code.
|
public static DescriptionBasedDiff create(com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit, ImportOrganizer importOrganizer)
public static DescriptionBasedDiff createIgnoringOverlaps(com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit, ImportOrganizer importOrganizer)
public String getRelevantFileName()
Diff
getRelevantFileName
in interface Diff
public boolean isEmpty()
public void onDescribed(Description description)
DescriptionListener
onDescribed
in interface DescriptionListener
public void handleFix(Fix fix)
public void applyDifferences(SourceFile sourceFile) throws DiffNotApplicableException
Diff
sourceFile
.applyDifferences
in interface Diff
DiffNotApplicableException
- if the diff could not be applied to the source fileCopyright © 2017. All rights reserved.