Interface AnnotationDescription
- All Known Subinterfaces:
AnnotationDescription.Loadable<S>
- All Known Implementing Classes:
AnnotationDescription.AbstractBase
,AnnotationDescription.ForLoadedAnnotation
,AnnotationDescription.Latent
,AnnotationDescription.Latent.Loadable
,TypePool.Default.LazyTypeDescription.LazyAnnotationDescription
,TypePool.Default.LazyTypeDescription.LazyAnnotationDescription.Loadable
public interface AnnotationDescription
An annotation description describes
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 asTypeDescription
s.Enum
instances are represented asEnumerationDescription
s.Annotation
s are described asAnnotationDescription
s.- All primitive types are represented as their wrapper types.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
An adapter implementation of an annotation.static class
AnInvocationHandler
for implementing annotations.static class
A builder for pragmatically creatingAnnotationDescription
.static class
A description of an already loaded annotation.static class
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 enum
A rendering dispatcher is responsible for resolving annotation descriptions toString
representations. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AnnotationDescription.Loadable
<?> Indicates a nonexistent annotation in a type-safe manner. -
Method Summary
Modifier and TypeMethodDescriptionReturns a description of the annotation type of this annotation.Returns a set of allElementType
s that can declare this annotation.Returns this annotation's retention policy.AnnotationValue
<?, ?> Returns a value of this annotation.AnnotationValue
<?, ?> getValue
(MethodDescription.InDefinedShape property) Returns a value of this annotation.boolean
Checks if this annotation is documented.boolean
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>
AnnotationDescription.Loadable<T> Links this annotation description to a given annotation type such that it can be loaded.
-
Field Details
-
UNDEFINED
Indicates a nonexistent annotation in a type-safe manner.
-
-
Method Details
-
getValue
Returns a value of this annotation.- Parameters:
property
- The name of the property being accessed.- Returns:
- The value for the supplied property.
-
getValue
Returns a value of this annotation.- Parameters:
property
- The property being accessed.- Returns:
- The value for the supplied property.
-
getAnnotationType
TypeDescription getAnnotationType()Returns a description of the annotation type of this annotation.- Returns:
- A description of the annotation type of this annotation.
-
prepare
Links this annotation description to a given annotation type such that it can be loaded. This does not cause the values of this annotation to be loaded.- Type Parameters:
T
- The type of the annotation.- Parameters:
annotationType
- The loaded annotation type of this annotation description.- Returns:
- A loadable version of this annotation description.
-
getRetention
RetentionPolicy getRetention()Returns this annotation's retention policy.- Returns:
- This annotation's retention policy.
-
getElementTypes
Set<ElementType> getElementTypes()Returns a set of allElementType
s that can declare this annotation.- Returns:
- A set of all element types that can declare this annotation.
-
isSupportedOn
Checks if this annotation is supported on the supplied element type.- Parameters:
elementType
- The element type to check.- Returns:
true
if the supplied element type is supported by this annotation.
-
isSupportedOn
Checks if this annotation is supported on the supplied element type.- Parameters:
elementType
- The element type to check.- Returns:
true
if the supplied element type is supported by this annotation.
-
isInherited
boolean isInherited()Checks if this annotation is inherited.- Returns:
true
if this annotation is inherited.- See Also:
-
isDocumented
boolean isDocumented()Checks if this annotation is documented.- Returns:
true
if this annotation is documented.- See Also:
-