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:
Classinstances are represented asTypeDescriptions.Enuminstances are represented asEnumerationDescriptions.Annotations are described asAnnotationDescriptions.- All primitive types are represented as their wrapper types.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAn adapter implementation of an annotation.static classAnInvocationHandlerfor implementing annotations.static classA builder for pragmatically creatingAnnotationDescription.static classA description of an already loaded annotation.static classA latent description of an annotation value that is defined explicitly.static interfaceAnnotationDescription.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 enumA rendering dispatcher is responsible for resolving annotation descriptions toStringrepresentations. -
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 allElementTypes 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.booleanChecks if this annotation is documented.booleanChecks if this annotation is inherited.booleanisSupportedOn(ElementType elementType) Checks if this annotation is supported on the supplied element type.booleanisSupportedOn(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 allElementTypes 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:
trueif 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:
trueif the supplied element type is supported by this annotation.
-
isInherited
boolean isInherited()Checks if this annotation is inherited.- Returns:
trueif this annotation is inherited.- See Also:
-
isDocumented
boolean isDocumented()Checks if this annotation is documented.- Returns:
trueif this annotation is documented.- See Also:
-