Package io.quarkus.arc.processor
Class AnnotationsTransformer.AbstractBuilder<THIS extends AnnotationsTransformer.AbstractBuilder<THIS>>
- java.lang.Object
-
- io.quarkus.arc.processor.AnnotationsTransformer.AbstractBuilder<THIS>
-
- All Implemented Interfaces:
Predicate<org.jboss.jandex.AnnotationTarget.Kind>
- Direct Known Subclasses:
AnnotationsTransformer.Builder,AnnotationsTransformer.ClassTransformerBuilder,AnnotationsTransformer.FieldTransformerBuilder,AnnotationsTransformer.MethodTransformerBuilder
- Enclosing interface:
- AnnotationsTransformer
public abstract static class AnnotationsTransformer.AbstractBuilder<THIS extends AnnotationsTransformer.AbstractBuilder<THIS>> extends Object implements Predicate<org.jboss.jandex.AnnotationTarget.Kind>
-
-
Field Summary
Fields Modifier and Type Field Description protected Predicate<AnnotationsTransformer.TransformationContext>predicateprotected intpriority
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description THISpriority(int priority)protected THISself()AnnotationsTransformerthenTransform(Consumer<Transformation> consumer)If all conditions are met then apply the transformation logic.AnnotationsTransformertransform(Consumer<AnnotationsTransformer.TransformationContext> consumer)The transformation logic is performed only if all conditions are met.THISwhen(Predicate<AnnotationsTransformer.TransformationContext> when)The transformation logic is only performed if the given predicate is evaluated to true.THISwhenContainsAll(Class<? extends Annotation>... annotationNames)AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.THISwhenContainsAll(List<org.jboss.jandex.DotName> annotationNames)AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.THISwhenContainsAll(org.jboss.jandex.DotName... annotationNames)AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.THISwhenContainsAny(Class<? extends Annotation>... annotationNames)AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.THISwhenContainsAny(List<org.jboss.jandex.DotName> annotationNames)AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.THISwhenContainsAny(org.jboss.jandex.DotName... annotationNames)AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.THISwhenContainsNone(Class<? extends Annotation>... annotationNames)AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.THISwhenContainsNone(List<org.jboss.jandex.DotName> annotationNames)AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.THISwhenContainsNone(org.jboss.jandex.DotName... annotationNames)AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.protected <TARGET> Predicate<AnnotationsTransformer.TransformationContext>wrap(Predicate<TARGET> condition, Function<AnnotationsTransformer.TransformationContext,TARGET> extractor)
-
-
-
Field Detail
-
priority
protected int priority
-
predicate
protected Predicate<AnnotationsTransformer.TransformationContext> predicate
-
-
Method Detail
-
priority
public THIS priority(int priority)
- Parameters:
priority-- Returns:
- self
-
whenContainsAll
public THIS whenContainsAll(List<org.jboss.jandex.DotName> annotationNames)
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAll
public THIS whenContainsAll(org.jboss.jandex.DotName... annotationNames)
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAll
@SafeVarargs public final THIS whenContainsAll(Class<? extends Annotation>... annotationNames)
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAny
public THIS whenContainsAny(List<org.jboss.jandex.DotName> annotationNames)
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAny
public THIS whenContainsAny(org.jboss.jandex.DotName... annotationNames)
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAny
@SafeVarargs public final THIS whenContainsAny(Class<? extends Annotation>... annotationNames)
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsNone
public THIS whenContainsNone(List<org.jboss.jandex.DotName> annotationNames)
AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsNone
public THIS whenContainsNone(org.jboss.jandex.DotName... annotationNames)
AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsNone
@SafeVarargs public final THIS whenContainsNone(Class<? extends Annotation>... annotationNames)
AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
when
public THIS when(Predicate<AnnotationsTransformer.TransformationContext> when)
The transformation logic is only performed if the given predicate is evaluated to true. Multiple predicates are logically-ANDed.- Parameters:
predicate-- Returns:
- self
-
thenTransform
public AnnotationsTransformer thenTransform(Consumer<Transformation> consumer)
If all conditions are met then apply the transformation logic.Unlike in
transform(Consumer)the transformation is automatically applied, i.e. aTransformationis created and theAnnotationsTransformation.done()method is called automatically.- Parameters:
consumer-- Returns:
- a new annotation transformer
-
transform
public AnnotationsTransformer transform(Consumer<AnnotationsTransformer.TransformationContext> consumer)
The transformation logic is performed only if all conditions are met.This method should be used if you need to access the transformation context directly. Otherwise, the
thenTransform(Consumer)is more convenient.- Parameters:
consumer-- Returns:
- a new annotation transformer
- See Also:
thenTransform(Consumer)
-
self
protected THIS self()
-
wrap
protected <TARGET> Predicate<AnnotationsTransformer.TransformationContext> wrap(Predicate<TARGET> condition, Function<AnnotationsTransformer.TransformationContext,TARGET> extractor)
-
-