Package com.google.errorprone.scanner
Class ErrorProneScannerTransformer
java.lang.Object
com.google.errorprone.scanner.ErrorProneScannerTransformer
- All Implemented Interfaces:
CodeTransformer
public abstract class ErrorProneScannerTransformer extends Object implements CodeTransformer
Adapter from an
ErrorProneScanner
to a CodeTransformer
.-
Constructor Summary
Constructors Constructor Description ErrorProneScannerTransformer()
-
Method Summary
Modifier and Type Method Description com.google.common.collect.ImmutableClassToInstanceMap<Annotation>
annotations()
Returns a map of annotation data logically applied to this code transformer.void
apply(com.sun.source.util.TreePath tree, com.sun.tools.javac.util.Context context, DescriptionListener listener)
Apply recursively from the leaf node in the givenTreePath
.static ErrorProneScannerTransformer
create(Scanner scanner)
-
Constructor Details
-
ErrorProneScannerTransformer
public ErrorProneScannerTransformer()
-
-
Method Details
-
create
-
apply
public void apply(com.sun.source.util.TreePath tree, com.sun.tools.javac.util.Context context, DescriptionListener listener)Description copied from interface:CodeTransformer
Apply recursively from the leaf node in the givenTreePath
.- Specified by:
apply
in interfaceCodeTransformer
-
annotations
Description copied from interface:CodeTransformer
Returns a map of annotation data logically applied to this code transformer.As an example, if a
CodeTransformer
expressed as a Refaster rule had an annotation applied to it:
You could retrieve the value of@MyCustomAnnotation("value") public class AnnotatedRefasterRule { @BeforeTemplate void before(String x) {...} @AfterTemplate void after(String x) {...} }
@MyCustomAnnotation
from this map.- Specified by:
annotations
in interfaceCodeTransformer
-