Class AnnotationOverlayImpl
- All Implemented Interfaces:
AnnotationOverlay
- Direct Known Subclasses:
MutableAnnotationOverlayImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classNested classes/interfaces inherited from interface 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 AnnotationInstanceannotation(Declaration declaration, DotName name) Returns the annotation instance with givennamedeclared 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 givennamedeclared on givendeclaration.(package private) Collection<AnnotationInstance> getAnnotationsFor(Declaration declaration) (package private) final Collection<AnnotationInstance> getOriginalAnnotations(Declaration declaration) final booleanhasAnnotation(Declaration declaration, DotName name) Returns whether an annotation instance with givennameis declared on givendeclaration.final booleanhasAnyAnnotation(Declaration declaration, Set<DotName> names) Returns whether any annotation instance with one of givennamesis declared on givendeclaration.final IndexViewindex()Returns the index whose annotation information is being overlaid.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:AnnotationOverlayReturns the index whose annotation information is being overlaid.- Specified by:
indexin interfaceAnnotationOverlay- Returns:
- the index underlying this annotation overlay, never
null
-
hasAnnotation
Description copied from interface:AnnotationOverlayReturns whether an annotation instance with givennameis 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:
hasAnnotationin interfaceAnnotationOverlay- Parameters:
declaration- the declaration to inspect, must not benullname- name of the annotation type to look for, must not benull- Returns:
trueif the annotation is present,falseotherwise
-
hasAnyAnnotation
Description copied from interface:AnnotationOverlayReturns whether any annotation instance with one of givennamesis 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:
hasAnyAnnotationin interfaceAnnotationOverlay- Parameters:
declaration- the declaration to inspect, must not benullnames- names of the annotation types to look for, must not benull- Returns:
trueif any of the annotations is present,falseotherwise
-
annotation
Description copied from interface:AnnotationOverlayReturns the annotation instance with givennamedeclared 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 givennameis present, an unspecified instance is returned.- Specified by:
annotationin interfaceAnnotationOverlay- Parameters:
declaration- the declaration to inspect, must not benullname- name of the annotation type to look for, must not benull- Returns:
- the annotation instance, or
nullif not found
-
annotationsWithRepeatable
public final Collection<AnnotationInstance> annotationsWithRepeatable(Declaration declaration, DotName name) Description copied from interface:AnnotationOverlayReturns the annotation instances with givennamedeclared 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:
annotationsWithRepeatablein interfaceAnnotationOverlay- Parameters:
declaration- the declaration to inspect, must not benullname- name of the annotation type, must not benull- Returns:
- immutable collection of annotation instances, never
null
-
annotations
Description copied from interface:AnnotationOverlayReturns 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:
annotationsin interfaceAnnotationOverlay- Parameters:
declaration- the declaration to inspect, must not benull- Returns:
- immutable collection of annotation instances, never
null
-
getAnnotationsFor
-
getOriginalAnnotations
-