Class ErrorProneScannerTransformer

All Implemented Interfaces:

public abstract class ErrorProneScannerTransformer extends Object implements CodeTransformer
Adapter from an ErrorProneScanner to a CodeTransformer.
  • Constructor Details

    • ErrorProneScannerTransformer

      public ErrorProneScannerTransformer()
  • Method Details

    • create

      public static ErrorProneScannerTransformer create(Scanner scanner)
    • apply

      public void apply(com.sun.source.util.TreePath tree, context, DescriptionListener listener)
      Description copied from interface: CodeTransformer
      Apply recursively from the leaf node in the given TreePath.
      Specified by:
      apply in interface CodeTransformer
    • annotations

      public<Annotation> 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:

       public class AnnotatedRefasterRule {
          @BeforeTemplate void before(String x) {...}
          @AfterTemplate void after(String x) {...}
      You could retrieve the value of @MyCustomAnnotation from this map.
      Specified by:
      annotations in interface CodeTransformer