Package org.jboss.jandex
Interface AnnotationTransformation
-
public interface AnnotationTransformation
An annotation transformation.- Since:
- 3.2.0
- See Also:
priority()
,supports(AnnotationTarget.Kind)
,apply(TransformationContext)
,builder()
,forClasses()
,forFields()
,forMethods()
,forMethodParameters()
,forRecordComponents()
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AnnotationTransformation.Builder<THIS extends AnnotationTransformation.Builder<THIS>>
Abstract class for annotation transformation builders.static class
AnnotationTransformation.ClassBuilder
A builder of annotation transformations for classes.static class
AnnotationTransformation.DeclarationBuilder
A builder of annotation transformations for arbitrary declarations.static class
AnnotationTransformation.FieldBuilder
A builder of annotation transformations for fields.static class
AnnotationTransformation.MethodBuilder
A builder of annotation transformations for methods.static class
AnnotationTransformation.MethodParameterBuilder
A builder of annotation transformations for method parameters.static class
AnnotationTransformation.RecordComponentBuilder
A builder of annotation transformations for record components.static interface
AnnotationTransformation.TransformationContext
A transformation context.
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PRIORITY_VALUE
The defaultpriority()
value: 1000.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
apply(AnnotationTransformation.TransformationContext context)
Implements the actual annotation transformation.static AnnotationTransformation.DeclarationBuilder
builder()
Returns a builder for annotation transformation of arbitrary declarations.static AnnotationTransformation.ClassBuilder
forClasses()
Returns a builder for annotation transformation of classes.static AnnotationTransformation.FieldBuilder
forFields()
Returns a builder for annotation transformation of fields.static AnnotationTransformation.MethodParameterBuilder
forMethodParameters()
Returns a builder for annotation transformation of method parameters.static AnnotationTransformation.MethodBuilder
forMethods()
Returns a builder for annotation transformation of methods.static AnnotationTransformation.RecordComponentBuilder
forRecordComponents()
Returns a builder for annotation transformation of record components.default int
priority()
Returns the priority of this annotation transformation.default boolean
requiresCompatibleMode()
Returns whether this annotation transformation requires the annotation overlay to be in the compatible mode.default boolean
supports(AnnotationTarget.Kind kind)
Returns whether this annotation transformation supports givenkind
of declarations.
-
-
-
Field Detail
-
DEFAULT_PRIORITY_VALUE
static final int DEFAULT_PRIORITY_VALUE
The defaultpriority()
value: 1000.- See Also:
- Constant Field Values
-
-
Method Detail
-
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 givenkind
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, nevernull
- Returns:
- whether this annotation transformation should apply
-
apply
void apply(AnnotationTransformation.TransformationContext context)
Implements the actual annotation transformation.- Parameters:
context
- the transformation context, nevernull
-
requiresCompatibleMode
default boolean requiresCompatibleMode()
Returns whether this annotation transformation requires the annotation overlay to be in the compatible mode. When this method returnstrue
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
static AnnotationTransformation.DeclarationBuilder builder()
Returns a builder for annotation transformation of arbitrary declarations.- Returns:
- a builder for annotation transformation of arbitrary declarations
-
forClasses
static AnnotationTransformation.ClassBuilder forClasses()
Returns a builder for annotation transformation of classes.- Returns:
- a builder for annotation transformation of classes
-
forFields
static AnnotationTransformation.FieldBuilder forFields()
Returns a builder for annotation transformation of fields.- Returns:
- a builder for annotation transformation of fields
-
forMethods
static AnnotationTransformation.MethodBuilder forMethods()
Returns a builder for annotation transformation of methods.- Returns:
- a builder for annotation transformation of methods
-
forMethodParameters
static AnnotationTransformation.MethodParameterBuilder forMethodParameters()
Returns a builder for annotation transformation of method parameters.- Returns:
- a builder for annotation transformation of method parameters
-
forRecordComponents
static AnnotationTransformation.RecordComponentBuilder forRecordComponents()
Returns a builder for annotation transformation of record components.- Returns:
- a builder for annotation transformation of record components
-
-