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