public interface AnnotationDescription
Annotation
meta data of a class without this class
being required to be loaded. All values of an annotation are therefore represented in unloaded state:
Class
instances are represented as TypeDescription
s.Enum
instances are represented as
EnumerationDescription
s.Annotation
s are described as
AnnotationDescription
s.Modifier and Type | Interface and Description |
---|---|
static class |
AnnotationDescription.AbstractBase
An adapter implementation of an annotation.
|
static class |
AnnotationDescription.AnnotationInvocationHandler<T extends Annotation>
An
InvocationHandler for implementing annotations. |
static class |
AnnotationDescription.Builder
A builder for pragmatically creating
AnnotationDescription . |
static class |
AnnotationDescription.ForLoadedAnnotation<S extends Annotation>
A description of an already loaded annotation.
|
static class |
AnnotationDescription.Latent
A latent description of an annotation value that is defined explicitly.
|
static interface |
AnnotationDescription.Loadable<S extends Annotation>
An annotation description that is linked to a given loaded annotation type which allows its representation
as a fully loaded instance.
|
static class |
AnnotationDescription.RenderingDispatcher
A rendering dispatcher is responsible for resolving annotation descriptions to
String representations. |
Modifier and Type | Field and Description |
---|---|
static AnnotationDescription.Loadable<?> |
UNDEFINED
Indicates a nonexistent annotation in a type-safe manner.
|
Modifier and Type | Method and Description |
---|---|
TypeDescription |
getAnnotationType()
Returns a description of the annotation type of this annotation.
|
Set<ElementType> |
getElementTypes()
Returns a set of all
ElementType s that can declare this annotation. |
RetentionPolicy |
getRetention()
Returns this annotation's retention policy.
|
AnnotationValue<?,?> |
getValue(MethodDescription.InDefinedShape property)
Returns a value of this annotation.
|
AnnotationValue<?,?> |
getValue(String property)
Returns a value of this annotation.
|
boolean |
isDocumented()
Checks if this annotation is documented.
|
boolean |
isInherited()
Checks if this annotation is inherited.
|
boolean |
isSupportedOn(ElementType elementType)
Checks if this annotation is supported on the supplied element type.
|
boolean |
isSupportedOn(String elementType)
Checks if this annotation is supported on the supplied element type.
|
<T extends Annotation> |
prepare(Class<T> annotationType)
Links this annotation description to a given annotation type such that it can be loaded.
|
@AlwaysNull static final AnnotationDescription.Loadable<?> UNDEFINED
AnnotationValue<?,?> getValue(String property)
property
- The name of the property being accessed.AnnotationValue<?,?> getValue(MethodDescription.InDefinedShape property)
property
- The property being accessed.TypeDescription getAnnotationType()
<T extends Annotation> AnnotationDescription.Loadable<T> prepare(Class<T> annotationType)
T
- The type of the annotation.annotationType
- The loaded annotation type of this annotation description.RetentionPolicy getRetention()
Set<ElementType> getElementTypes()
ElementType
s that can declare this annotation.boolean isSupportedOn(ElementType elementType)
elementType
- The element type to check.true
if the supplied element type is supported by this annotation.boolean isSupportedOn(String elementType)
elementType
- The element type to check.true
if the supplied element type is supported by this annotation.boolean isInherited()
true
if this annotation is inherited.Inherited
boolean isDocumented()
true
if this annotation is documented.Documented
Copyright © 2014–2024. All rights reserved.