Package org.jboss.jandex
Class AnnotationTransformation.Builder<THIS extends AnnotationTransformation.Builder<THIS>>
java.lang.Object
org.jboss.jandex.AnnotationTransformation.Builder<THIS>
- Type Parameters:
THIS
- type of this builder
- Direct Known Subclasses:
AnnotationTransformation.ClassBuilder
,AnnotationTransformation.DeclarationBuilder
,AnnotationTransformation.FieldBuilder
,AnnotationTransformation.MethodBuilder
,AnnotationTransformation.MethodParameterBuilder
,AnnotationTransformation.RecordComponentBuilder
- Enclosing interface:
AnnotationTransformation
public abstract static class AnnotationTransformation.Builder<THIS extends AnnotationTransformation.Builder<THIS>>
extends Object
Abstract class for annotation transformation builders.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Predicate
<AnnotationInstance> annotationPredicate
(Class<? extends Annotation>... classes) private static Predicate
<AnnotationInstance> annotationPredicate
(DotName... classes) final THIS
priority
(int priority) Sets the priority of the built annotation transformation.(package private) THIS
self()
transform
(Consumer<AnnotationTransformation.TransformationContext> transformation) Builds an annotation transformation based on the giventransformation
function.Adds a predicate to the list of predicates that will be tested before applying the transformation.final THIS
whenAllMatch
(Class<? extends Annotation>... classes) Adds a predicate that tests whether all of the current set of annotations are of givenclasses
.final THIS
whenAllMatch
(Predicate<AnnotationInstance> predicate) Adds a predicate that tests whether all of the current set of annotations match the givenpredicate
.final THIS
whenAllMatch
(List<DotName> classes) Adds a predicate that tests whether all of the current set of annotations are of givenclasses
.final THIS
whenAllMatch
(DotName... classes) Adds a predicate that tests whether all of the current set of annotations are of givenclasses
.final THIS
whenAnyMatch
(Class<? extends Annotation>... classes) Adds a predicate that tests whether any of the current set of annotations is of givenclasses
.final THIS
whenAnyMatch
(Predicate<AnnotationInstance> predicate) Adds a predicate that tests whether any of the current set of annotations matches the givenpredicate
.final THIS
whenAnyMatch
(List<DotName> classes) Adds a predicate that tests whether any of the current set of annotations is of givenclasses
.final THIS
whenAnyMatch
(DotName... classes) Adds a predicate that tests whether any of the current set of annotations is of givenclasses
.final THIS
whenNoneMatch
(Class<? extends Annotation>... classes) Adds a predicate that tests whether none of the current set of annotations is of givenclasses
.final THIS
whenNoneMatch
(Predicate<AnnotationInstance> predicate) Adds a predicate that tests whether none of the current set of annotations matches the givenpredicate
.final THIS
whenNoneMatch
(List<DotName> classes) Adds a predicate that tests whether none of the current set of annotations is of givenclasses
.final THIS
whenNoneMatch
(DotName... classes) Adds a predicate that tests whether none of the current set of annotations is of givenclasses
.
-
Field Details
-
kind
-
priority
private int priority -
predicate
-
-
Constructor Details
-
Builder
Builder(AnnotationTarget.Kind kind)
-
-
Method Details
-
priority
Sets the priority of the built annotation transformation. By default, the priority isAnnotationTransformation.DEFAULT_PRIORITY_VALUE
.- Parameters:
priority
- the priority- Returns:
- this builder
-
annotationPredicate
@SafeVarargs private static Predicate<AnnotationInstance> annotationPredicate(Class<? extends Annotation>... classes) -
annotationPredicate
-
whenAnyMatch
Adds a predicate that tests whether any of the current set of annotations is of givenclasses
.- Parameters:
classes
- the annotation classes, must not benull
- Returns:
- this builder
- See Also:
-
whenAnyMatch
Adds a predicate that tests whether any of the current set of annotations is of givenclasses
.- Parameters:
classes
- the annotation classes, must not benull
- Returns:
- this builder
- See Also:
-
whenAnyMatch
Adds a predicate that tests whether any of the current set of annotations is of givenclasses
.- Parameters:
classes
- the annotation classes, must not benull
- Returns:
- this builder
- See Also:
-
whenAnyMatch
Adds a predicate that tests whether any of the current set of annotations matches the givenpredicate
.- Parameters:
predicate
- the predicate, must not benull
- Returns:
- this builder
- See Also:
-
whenAllMatch
Adds a predicate that tests whether all of the current set of annotations are of givenclasses
.- Parameters:
classes
- the annotation classes, must not benull
- Returns:
- this builder
- See Also:
-
whenAllMatch
Adds a predicate that tests whether all of the current set of annotations are of givenclasses
.- Parameters:
classes
- the annotation classes, must not benull
- Returns:
- this builder
- See Also:
-
whenAllMatch
Adds a predicate that tests whether all of the current set of annotations are of givenclasses
.- Parameters:
classes
- the annotation classes, must not benull
- Returns:
- this builder
- See Also:
-
whenAllMatch
Adds a predicate that tests whether all of the current set of annotations match the givenpredicate
.- Parameters:
predicate
- the predicate, must not benull
- Returns:
- this builder
- See Also:
-
whenNoneMatch
Adds a predicate that tests whether none of the current set of annotations is of givenclasses
.- Parameters:
classes
- the annotation classes, must not benull
- Returns:
- this builder
- See Also:
-
whenNoneMatch
Adds a predicate that tests whether none of the current set of annotations is of givenclasses
.- Parameters:
classes
- the annotation classes, must not benull
- Returns:
- this builder
- See Also:
-
whenNoneMatch
Adds a predicate that tests whether none of the current set of annotations is of givenclasses
.- Parameters:
classes
- the annotation classes, must not benull
- Returns:
- this builder
- See Also:
-
whenNoneMatch
Adds a predicate that tests whether none of the current set of annotations matches the givenpredicate
.- Parameters:
predicate
- the predicate, must not benull
- Returns:
- this builder
- See Also:
-
when
Adds a predicate to the list of predicates that will be tested before applying the transformation. If some of the predicates returnsfalse
, the transformation is not applied. In other words, the predicates are combined using logical and (conjunction).- Parameters:
predicate
- the predicate, must not benull
- Returns:
- this builder
-
transform
public AnnotationTransformation transform(Consumer<AnnotationTransformation.TransformationContext> transformation) Builds an annotation transformation based on the giventransformation
function.- Parameters:
transformation
- the transformation function, must not benull
- Returns:
- the built annotation transformation, never
null
-
self
THIS self()
-