Class AnnotationOverlayImpl
- All Implemented Interfaces:
AnnotationOverlay
- Direct Known Subclasses:
MutableAnnotationOverlayImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
Nested classes/interfaces inherited from interface org.jboss.jandex.AnnotationOverlay
AnnotationOverlay.Builder
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final boolean
(package private) final IndexView
(package private) final boolean
(package private) final Map
<EquivalenceKey, Collection<AnnotationInstance>> (package private) final boolean
(package private) final List
<AnnotationTransformation> -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationOverlayImpl
(IndexView index, boolean compatibleMode, boolean runtimeAnnotationsOnly, boolean inheritedAnnotations, Collection<AnnotationTransformation> annotationTransformations) -
Method Summary
Modifier and TypeMethodDescriptionfinal AnnotationInstance
annotation
(Declaration declaration, DotName name) Returns the annotation instance with givenname
declared on givendeclaration
.final Collection
<AnnotationInstance> annotations
(Declaration declaration) Returns the annotation instances declared on givendeclaration
.final Collection
<AnnotationInstance> annotationsWithRepeatable
(Declaration declaration, DotName name) Returns the annotation instances with givenname
declared on givendeclaration
.(package private) Collection
<AnnotationInstance> getAnnotationsFor
(Declaration declaration) (package private) final Collection
<AnnotationInstance> getOriginalAnnotations
(Declaration declaration) final boolean
hasAnnotation
(Declaration declaration, DotName name) Returns whether an annotation instance with givenname
is declared on givendeclaration
.final boolean
hasAnyAnnotation
(Declaration declaration, Set<DotName> names) Returns whether any annotation instance with one of givennames
is declared on givendeclaration
.final IndexView
index()
Returns the index whose annotation information is being overlaid.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jboss.jandex.AnnotationOverlay
annotation, annotationsWithRepeatable, hasAnnotation, hasAnyAnnotation
-
Field Details
-
index
-
compatibleMode
final boolean compatibleMode -
runtimeAnnotationsOnly
final boolean runtimeAnnotationsOnly -
inheritedAnnotations
final boolean inheritedAnnotations -
transformations
-
overlay
-
-
Constructor Details
-
AnnotationOverlayImpl
AnnotationOverlayImpl(IndexView index, boolean compatibleMode, boolean runtimeAnnotationsOnly, boolean inheritedAnnotations, Collection<AnnotationTransformation> annotationTransformations)
-
-
Method Details
-
index
Description copied from interface:AnnotationOverlay
Returns the index whose annotation information is being overlaid.- Specified by:
index
in interfaceAnnotationOverlay
- Returns:
- the index underlying this annotation overlay, never
null
-
hasAnnotation
Description copied from interface:AnnotationOverlay
Returns whether an annotation instance with givenname
is declared on givendeclaration
.Like
AnnotationTarget.hasDeclaredAnnotation(DotName)
, and unlikeAnnotationTarget.hasAnnotation(DotName)
, this method ignores annotations declared on nested annotation targets. This doesn't hold in case of methods in the compatible mode, where method parameters are considered part of methods.- Specified by:
hasAnnotation
in interfaceAnnotationOverlay
- Parameters:
declaration
- the declaration to inspect, must not benull
name
- name of the annotation type to look for, must not benull
- Returns:
true
if the annotation is present,false
otherwise
-
hasAnyAnnotation
Description copied from interface:AnnotationOverlay
Returns whether any annotation instance with one of givennames
is declared on givendeclaration
.This method ignores annotations declared on nested annotation targets. This doesn't hold in case of methods in the compatible mode, where method parameters are considered part of methods.
- Specified by:
hasAnyAnnotation
in interfaceAnnotationOverlay
- Parameters:
declaration
- the declaration to inspect, must not benull
names
- names of the annotation types to look for, must not benull
- Returns:
true
if any of the annotations is present,false
otherwise
-
annotation
Description copied from interface:AnnotationOverlay
Returns the annotation instance with givenname
declared on givendeclaration
.Like
AnnotationTarget.declaredAnnotation(DotName)
, and unlikeAnnotationTarget.annotation(DotName)
, this method doesn't return annotations declared on nested annotation targets. This doesn't hold in case of methods in the compatible mode, where method parameters are considered part of methods. In such case, if more than one annotation of givenname
is present, an unspecified instance is returned.- Specified by:
annotation
in interfaceAnnotationOverlay
- Parameters:
declaration
- the declaration to inspect, must not benull
name
- name of the annotation type to look for, must not benull
- Returns:
- the annotation instance, or
null
if not found
-
annotationsWithRepeatable
public final Collection<AnnotationInstance> annotationsWithRepeatable(Declaration declaration, DotName name) Description copied from interface:AnnotationOverlay
Returns the annotation instances with givenname
declared on givendeclaration
. If the specified annotation is repeatable, the result also contains all values from the container annotation instance.The annotation class must be present in the index underlying this annotation overlay.
Like
AnnotationTarget.declaredAnnotationsWithRepeatable(DotName, IndexView)
, and unlikeAnnotationTarget.annotationsWithRepeatable(DotName, IndexView)
, this method doesn't return annotations declared on nested annotation targets. This doesn't hold in case of methods in the compatible mode, where method parameters are considered part of methods.- Specified by:
annotationsWithRepeatable
in interfaceAnnotationOverlay
- Parameters:
declaration
- the declaration to inspect, must not benull
name
- name of the annotation type, must not benull
- Returns:
- immutable collection of annotation instances, never
null
-
annotations
Description copied from interface:AnnotationOverlay
Returns the annotation instances declared on givendeclaration
.Like
AnnotationTarget.declaredAnnotations()
, and unlikeAnnotationTarget.annotations()
, this method doesn't return annotations declared on nested annotation targets. This doesn't hold in case of methods in the compatible mode, where method parameters are considered part of methods.- Specified by:
annotations
in interfaceAnnotationOverlay
- Parameters:
declaration
- the declaration to inspect, must not benull
- Returns:
- immutable collection of annotation instances, never
null
-
getAnnotationsFor
-
getOriginalAnnotations
-