public interface AnnotationList extends FilterableList<AnnotationDescription,AnnotationList>
Modifier and Type | Interface and Description |
---|---|
static class |
AnnotationList.AbstractBase
An abstract base implementation of an annotation list.
|
static class |
AnnotationList.Empty
Represents an empty annotation list.
|
static class |
AnnotationList.Explicit
Represents a list of explicitly provided annotation descriptions.
|
static class |
AnnotationList.ForLoadedAnnotations
Describes an array of loaded
Annotation s as an annotation list. |
Modifier and Type | Method and Description |
---|---|
TypeList |
asTypeList()
Returns a list of the annotation types of this list.
|
AnnotationList |
inherited(java.util.Set<? extends TypeDescription> ignoredTypes)
Returns only annotations that are marked as
Inherited as long as they are not
contained by the set of ignored annotation types. |
boolean |
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Checks if this list contains an annotation of the given type.
|
boolean |
isAnnotationPresent(TypeDescription annotationType)
Checks if this list contains an annotation of the given type.
|
<T extends java.lang.annotation.Annotation> |
ofType(java.lang.Class<T> annotationType)
Finds the first annotation of the given type and returns it.
|
AnnotationDescription |
ofType(TypeDescription annotationType)
Finds the first annotation of the given type and returns it.
|
AnnotationList |
visibility(ElementMatcher<? super java.lang.annotation.RetentionPolicy> matcher)
Only retains annotations with the given retention policy.
|
filter, getOnly, subList
boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType
- The type to find in the list.true
if the list contains the annotation type.boolean isAnnotationPresent(TypeDescription annotationType)
annotationType
- The type to find in the list.true
if the list contains the annotation type.<T extends java.lang.annotation.Annotation> AnnotationDescription.Loadable<T> ofType(java.lang.Class<T> annotationType)
T
- The annotation type.annotationType
- The type to be found in the list.null
if no such annotation was found.AnnotationDescription ofType(TypeDescription annotationType)
annotationType
- The type to be found in the list.null
if no such annotation was found.AnnotationList inherited(java.util.Set<? extends TypeDescription> ignoredTypes)
Inherited
as long as they are not
contained by the set of ignored annotation types.ignoredTypes
- A list of annotation types to be ignored from the lookup.AnnotationList visibility(ElementMatcher<? super java.lang.annotation.RetentionPolicy> matcher)
matcher
- A matcher for the required retention policy.TypeList asTypeList()