Package org.jboss.jandex
Class AnnotationOverlay.Builder
- java.lang.Object
-
- org.jboss.jandex.AnnotationOverlay.Builder
-
- Enclosing interface:
- AnnotationOverlay
public static final class AnnotationOverlay.Builder extends java.lang.Object
The builder for an annotation overlay.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<AnnotationTransformation>
annotationTransformations
private boolean
compatibleMode
private IndexView
index
private boolean
inheritedAnnotations
private boolean
runtimeAnnotationsOnly
-
Constructor Summary
Constructors Constructor Description Builder(IndexView index, java.util.Collection<AnnotationTransformation> annotationTransformations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationOverlay
build()
Builds and returns an annotation overlay based on the configuration of this builder.AnnotationOverlay.Builder
compatibleMode()
When called, the built annotation overlay shall treat method parameters as part of methods.AnnotationOverlay.Builder
inheritedAnnotations()
When called, the built annotation overlay shall return inherited annotations per the Java rules.AnnotationOverlay.Builder
runtimeAnnotationsOnly()
When called, the built annotation overlay shall only return runtime-retained annotations; class-retained annotations are ignored.
-
-
-
Field Detail
-
index
private final IndexView index
-
annotationTransformations
private final java.util.Collection<AnnotationTransformation> annotationTransformations
-
compatibleMode
private boolean compatibleMode
-
runtimeAnnotationsOnly
private boolean runtimeAnnotationsOnly
-
inheritedAnnotations
private boolean inheritedAnnotations
-
-
Constructor Detail
-
Builder
Builder(IndexView index, java.util.Collection<AnnotationTransformation> annotationTransformations)
-
-
Method Detail
-
compatibleMode
public AnnotationOverlay.Builder compatibleMode()
When called, the built annotation overlay shall treat method parameters as part of methods. This means that annotations on method parameters are returned when asking for annotations of a method, asking for annotations on method parameters results in an exception, and annotation transformations for method parameters are ignored.This method is called
compatibleMode
because the built annotation overlay is compatible with the previous implementation of the same concept in Quarkus.- Returns:
- this builder
-
runtimeAnnotationsOnly
public AnnotationOverlay.Builder runtimeAnnotationsOnly()
When called, the built annotation overlay shall only return runtime-retained annotations; class-retained annotations are ignored. Note that this only applies to annotations present in class files (and therefore in Jandex); annotations added to the overlay using annotation transformations are not inspected and are always returned.- Returns:
- this builder
-
inheritedAnnotations
public AnnotationOverlay.Builder inheritedAnnotations()
When called, the built annotation overlay shall return inherited annotations per the Java rules.- Returns:
- this builder
-
build
public AnnotationOverlay build()
Builds and returns an annotation overlay based on the configuration of this builder.- Returns:
- the annotation overlay, never
null
-
-