public interface AnnotationMetadataProvider extends AnnotationSource
AnnotationMetadata
.EMPTY
Modifier and Type | Method and Description |
---|---|
default <T extends Annotation> |
findAnnotation(Class<T> annotationClass)
Find an
AnnotationValue for the given annotation type. |
default <T extends Annotation> |
findAnnotation(String annotation)
Find an
AnnotationValue for the given annotation name. |
default <T extends Annotation> |
findDeclaredAnnotation(Class<T> annotationClass)
Get all of the values for the given annotation that are directly declared on the annotated element.
|
default <T extends Annotation> |
findDeclaredAnnotation(String annotation)
Get all of the values for the given annotation that are directly declared on the annotated element.
|
default AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
default boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
Return whether an annotation is present.
|
default boolean |
isDeclaredAnnotationPresent(Class<? extends Annotation> annotationClass)
Variation of
AnnotationSource.isAnnotationPresent(Class) for declared annotations. |
default <T extends Annotation> |
synthesize(Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
default Annotation[] |
synthesizeAll()
Synthesizes a new annotations from the metadata.
|
default <T extends Annotation> |
synthesizeAnnotationsByType(Class<T> annotationClass)
Synthesizes a new annotations from the metadata for the given type.
|
default Annotation[] |
synthesizeDeclared()
Synthesizes a new annotations from the metadata.
|
default <T extends Annotation> |
synthesizeDeclared(Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
default <T extends Annotation> |
synthesizeDeclaredAnnotationsByType(Class<T> annotationClass)
Synthesizes a new annotations from the metadata for the given type.
|
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
@NonNull default AnnotationMetadata getAnnotationMetadata()
AnnotationMetadata.EMPTY_METADATA
.AnnotationMetadata
default <T extends Annotation> T synthesize(Class<T> annotationClass)
AnnotationSource
synthesize
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation classdefault Annotation[] synthesizeAll()
AnnotationSource
synthesizeAll
in interface AnnotationSource
default Annotation[] synthesizeDeclared()
AnnotationSource
synthesizeDeclared
in interface AnnotationSource
default boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
AnnotationSource
isAnnotationPresent
in interface AnnotationSource
annotationClass
- The annotation classdefault boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationClass)
AnnotationSource
AnnotationSource.isAnnotationPresent(Class)
for declared annotations.isDeclaredAnnotationPresent
in interface AnnotationSource
annotationClass
- The annotation classdefault <T extends Annotation> T synthesizeDeclared(Class<T> annotationClass)
AnnotationSource
This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
synthesizeDeclared
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation classdefault <T extends Annotation> T[] synthesizeAnnotationsByType(Class<T> annotationClass)
AnnotationSource
synthesizeAnnotationsByType
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation typedefault <T extends Annotation> T[] synthesizeDeclaredAnnotationsByType(Class<T> annotationClass)
AnnotationSource
synthesizeDeclaredAnnotationsByType
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation typedefault <T extends Annotation> Optional<AnnotationValue<T>> findAnnotation(String annotation)
AnnotationSource
AnnotationValue
for the given annotation name.findAnnotation
in interface AnnotationSource
T
- The annotation typeannotation
- The annotation nameAnnotationValue
instancedefault <T extends Annotation> Optional<AnnotationValue<T>> findAnnotation(Class<T> annotationClass)
AnnotationSource
AnnotationValue
for the given annotation type.findAnnotation
in interface AnnotationSource
T
- The annotation typeannotationClass
- The annotationAnnotationValue
instancedefault <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(String annotation)
AnnotationSource
findDeclaredAnnotation
in interface AnnotationSource
T
- The annotation typeannotation
- The annotation nameAnnotationValue
instancedefault <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(Class<T> annotationClass)
AnnotationSource
findDeclaredAnnotation
in interface AnnotationSource
T
- The annotation typeannotationClass
- The annotation nameAnnotationValue
instance