Interface AnnotationTransformation


public interface AnnotationTransformation
An annotation transformation.
Since:
3.2.0
See Also:
  • Field Details

  • Method Details

    • priority

      default int priority()
      Returns the priority of this annotation transformation. Annotation transformations are applied in descending order of priority values (that is, transformation with higher priority value is executed sooner than transformation with smaller priority value).

      By default, the priority is DEFAULT_PRIORITY_VALUE.

      Returns:
      the priority of this annotation transformation
    • supports

      default boolean supports(AnnotationTarget.Kind kind)
      Returns whether this annotation transformation supports given kind of declarations. A transformation is only applied if it supports the correct kind of declarations.

      By default, the transformation supports all declaration kinds.

      Parameters:
      kind - the kind of declaration, never null
      Returns:
      whether this annotation transformation should apply
    • apply

      Implements the actual annotation transformation.
      Parameters:
      context - the transformation context, never null
    • requiresCompatibleMode

      default boolean requiresCompatibleMode()
      Returns whether this annotation transformation requires the annotation overlay to be in the compatible mode. When this method returns true and the annotation overlay is not set to be in the compatible mode, an exception is thrown during construction of the overlay.

      This method returns false by default and should be overridden sparingly.

      Returns:
      whether this transformation requires the annotation overlay to be in the compatible mode
    • builder

      Returns a builder for annotation transformation of arbitrary declarations.
      Returns:
      a builder for annotation transformation of arbitrary declarations
    • forClasses

      Returns a builder for annotation transformation of classes.
      Returns:
      a builder for annotation transformation of classes
    • forFields

      Returns a builder for annotation transformation of fields.
      Returns:
      a builder for annotation transformation of fields
    • forMethods

      Returns a builder for annotation transformation of methods.
      Returns:
      a builder for annotation transformation of methods
    • forMethodParameters

      Returns a builder for annotation transformation of method parameters.
      Returns:
      a builder for annotation transformation of method parameters
    • forRecordComponents

      Returns a builder for annotation transformation of record components.
      Returns:
      a builder for annotation transformation of record components