Class AnnotationOverlayImpl
- java.lang.Object
-
- org.jboss.jandex.AnnotationOverlayImpl
-
- All Implemented Interfaces:
AnnotationOverlay
- Direct Known Subclasses:
MutableAnnotationOverlayImpl
class AnnotationOverlayImpl extends java.lang.Object implements AnnotationOverlay
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAnnotationOverlayImpl.TransformationContextImpl-
Nested classes/interfaces inherited from interface org.jboss.jandex.AnnotationOverlay
AnnotationOverlay.Builder
-
-
Field Summary
Fields Modifier and Type Field Description (package private) booleancompatibleMode(package private) IndexViewindex(package private) booleaninheritedAnnotations(package private) java.util.Map<EquivalenceKey,java.util.Collection<AnnotationInstance>>overlay(package private) booleanruntimeAnnotationsOnly(package private) java.util.List<AnnotationTransformation>transformations
-
Constructor Summary
Constructors Constructor Description AnnotationOverlayImpl(IndexView index, boolean compatibleMode, boolean runtimeAnnotationsOnly, boolean inheritedAnnotations, java.util.Collection<AnnotationTransformation> annotationTransformations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationInstanceannotation(Declaration declaration, DotName name)Returns the annotation instance with givennamedeclared on givendeclaration.java.util.Collection<AnnotationInstance>annotations(Declaration declaration)Returns the annotation instances declared on givendeclaration.java.util.Collection<AnnotationInstance>annotationsWithRepeatable(Declaration declaration, DotName name)Returns the annotation instances with givennamedeclared on givendeclaration.(package private) java.util.Collection<AnnotationInstance>getAnnotationsFor(Declaration declaration)(package private) java.util.Collection<AnnotationInstance>getOriginalAnnotations(Declaration declaration)booleanhasAnnotation(Declaration declaration, DotName name)Returns whether an annotation instance with givennameis declared on givendeclaration.booleanhasAnyAnnotation(Declaration declaration, java.util.Set<DotName> names)Returns whether any annotation instance with one of givennamesis declared on givendeclaration.IndexViewindex()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 Detail
-
index
final IndexView index
-
compatibleMode
final boolean compatibleMode
-
runtimeAnnotationsOnly
final boolean runtimeAnnotationsOnly
-
inheritedAnnotations
final boolean inheritedAnnotations
-
transformations
final java.util.List<AnnotationTransformation> transformations
-
overlay
final java.util.Map<EquivalenceKey,java.util.Collection<AnnotationInstance>> overlay
-
-
Constructor Detail
-
AnnotationOverlayImpl
AnnotationOverlayImpl(IndexView index, boolean compatibleMode, boolean runtimeAnnotationsOnly, boolean inheritedAnnotations, java.util.Collection<AnnotationTransformation> annotationTransformations)
-
-
Method Detail
-
index
public final IndexView 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
public final boolean hasAnnotation(Declaration declaration, DotName name)
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
public final boolean hasAnyAnnotation(Declaration declaration, java.util.Set<DotName> names)
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
public final AnnotationInstance annotation(Declaration declaration, DotName name)
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 java.util.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
public final java.util.Collection<AnnotationInstance> annotations(Declaration declaration)
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
java.util.Collection<AnnotationInstance> getAnnotationsFor(Declaration declaration)
-
getOriginalAnnotations
final java.util.Collection<AnnotationInstance> getOriginalAnnotations(Declaration declaration)
-
-