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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int -
Method Summary
Modifier and TypeMethodDescriptionpriority(int priority) protected THISself()thenTransform(Consumer<Transformation> consumer) If all conditions are met then apply the transformation logic.The transformation logic is performed only if all conditions are met.The transformation logic is only performed if the given predicate is evaluated to true.final THISwhenContainsAll(Class<? extends Annotation>... annotationNames) AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.whenContainsAll(List<org.jboss.jandex.DotName> annotationNames) AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.whenContainsAll(org.jboss.jandex.DotName... annotationNames) AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.final THISwhenContainsAny(Class<? extends Annotation>... annotationNames) AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.whenContainsAny(List<org.jboss.jandex.DotName> annotationNames) AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.whenContainsAny(org.jboss.jandex.DotName... annotationNames) AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.final THISwhenContainsNone(Class<? extends Annotation>... annotationNames) AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.whenContainsNone(List<org.jboss.jandex.DotName> annotationNames) AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.whenContainsNone(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 Details
-
priority
protected int priority -
predicate
-
-
Method Details
-
priority
- Parameters:
priority-- Returns:
- self
-
whenContainsAll
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAll
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAll
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ALL of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAny
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAny
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsAny
AnnotationsTransformer.TransformationContext.getAnnotations()must contain ANY of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsNone
AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsNone
AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
whenContainsNone
AnnotationsTransformer.TransformationContext.getAnnotations()must NOT contain any of the given annotations.- Parameters:
annotationNames-- Returns:
- self
-
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
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:
-
self
-
wrap
protected <TARGET> Predicate<AnnotationsTransformer.TransformationContext> wrap(Predicate<TARGET> condition, Function<AnnotationsTransformer.TransformationContext, TARGET> extractor)
-