Class AnnotatedCompositeCodeTransformer

java.lang.Object
tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer
All Implemented Interfaces:
com.google.errorprone.CodeTransformer, Serializable

public abstract class AnnotatedCompositeCodeTransformer extends Object implements com.google.errorprone.CodeTransformer, Serializable
A CompositeCodeTransformer that augments the Description of Refaster rule matches.

The content is augmented based on custom annotations available on the matching CodeTransformer or on this CompositeCodeTransformer as a fallback, if any.

See Also:
  • Method Details

    • annotations

      public abstract com.google.common.collect.ImmutableClassToInstanceMap<Annotation> annotations()
      Specified by:
      annotations in interface com.google.errorprone.CodeTransformer
    • create

      public static AnnotatedCompositeCodeTransformer create(String packageName, com.google.common.collect.ImmutableList<com.google.errorprone.CodeTransformer> transformers, com.google.common.collect.ImmutableClassToInstanceMap<Annotation> annotations)
      Creates an instance of an AnnotatedCompositeCodeTransformer.
      Parameters:
      packageName - The package in which the wrapped CodeTransformers reside.
      transformers - The CodeTransformers to which to delegate.
      annotations - The annotations that are applicable to this CodeTransformer.
      Returns:
      A non-null AnnotatedCompositeCodeTransformer.
    • apply

      public final void apply(TreePath path, com.sun.tools.javac.util.Context context, com.google.errorprone.DescriptionListener listener)
      Specified by:
      apply in interface com.google.errorprone.CodeTransformer