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.AnnotationMetadatadefault <T extends java.lang.annotation.Annotation> T synthesize(java.lang.Class<T> annotationClass)
AnnotationSourcesynthesize in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation classdefault java.lang.annotation.Annotation[] synthesizeAll()
AnnotationSourcesynthesizeAll in interface AnnotationSourcedefault java.lang.annotation.Annotation[] synthesizeDeclared()
AnnotationSourcesynthesizeDeclared in interface AnnotationSourcedefault boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
AnnotationSourceisAnnotationPresent in interface AnnotationSourceannotationClass - The annotation classdefault boolean isDeclaredAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
AnnotationSourceAnnotationSource.isAnnotationPresent(Class) for declared annotations.isDeclaredAnnotationPresent in interface AnnotationSourceannotationClass - The annotation classdefault <T extends java.lang.annotation.Annotation> T synthesizeDeclared(java.lang.Class<T> annotationClass)
AnnotationSourceThis method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
synthesizeDeclared in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation classdefault <T extends java.lang.annotation.Annotation> T[] synthesizeAnnotationsByType(java.lang.Class<T> annotationClass)
AnnotationSourcesynthesizeAnnotationsByType in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation typedefault <T extends java.lang.annotation.Annotation> T[] synthesizeDeclaredAnnotationsByType(java.lang.Class<T> annotationClass)
AnnotationSourcesynthesizeDeclaredAnnotationsByType in interface AnnotationSourceT - The annotation generic typeannotationClass - The annotation typedefault <T extends java.lang.annotation.Annotation> java.util.Optional<AnnotationValue<T>> findAnnotation(java.lang.String annotation)
AnnotationSourceAnnotationValue for the given annotation name.findAnnotation in interface AnnotationSourceT - The annotation typeannotation - The annotation nameAnnotationValue instancedefault <T extends java.lang.annotation.Annotation> java.util.Optional<AnnotationValue<T>> findAnnotation(java.lang.Class<T> annotationClass)
AnnotationSourceAnnotationValue for the given annotation type.findAnnotation in interface AnnotationSourceT - The annotation typeannotationClass - The annotationAnnotationValue instancedefault <T extends java.lang.annotation.Annotation> java.util.Optional<AnnotationValue<T>> findDeclaredAnnotation(java.lang.String annotation)
AnnotationSourcefindDeclaredAnnotation in interface AnnotationSourceT - The annotation typeannotation - The annotation nameAnnotationValue instancedefault <T extends java.lang.annotation.Annotation> java.util.Optional<AnnotationValue<T>> findDeclaredAnnotation(java.lang.Class<T> annotationClass)
AnnotationSourcefindDeclaredAnnotation in interface AnnotationSourceT - The annotation typeannotationClass - The annotation nameAnnotationValue instance