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 AnnotationDescriptionAn annotation description describesAnnotationmeta 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 Classes Modifier and Type Interface Description static classAnnotationDescription.AbstractBaseAn adapter implementation of an annotation.static classAnnotationDescription.AnnotationInvocationHandler<T extends java.lang.annotation.Annotation>AnInvocationHandlerfor implementing annotations.static classAnnotationDescription.BuilderA builder for pragmatically creatingAnnotationDescription.static classAnnotationDescription.ForLoadedAnnotation<S extends java.lang.annotation.Annotation>A description of an already loaded annotation.static classAnnotationDescription.LatentA latent description of an annotation value that is defined explicitly.static interfaceAnnotationDescription.Loadable<S extends java.lang.annotation.Annotation>An annotation description that is linked to a given loaded annotation type which allows its representation as a fully loaded instance.static classAnnotationDescription.RenderingDispatcherA rendering dispatcher is responsible for resolving annotation descriptions toStringrepresentations.
-
Field Summary
Fields Modifier and Type Field Description static AnnotationDescription.Loadable<?>UNDEFINEDIndicates a nonexistent annotation in a type-safe manner.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TypeDescriptiongetAnnotationType()Returns a description of the annotation type of this annotation.java.util.Set<java.lang.annotation.ElementType>getElementTypes()Returns a set of allElementTypes that can declare this annotation.java.lang.annotation.RetentionPolicygetRetention()Returns this annotation's retention policy.AnnotationValue<?,?>getValue(java.lang.String property)Returns a value of this annotation.AnnotationValue<?,?>getValue(MethodDescription.InDefinedShape property)Returns a value of this annotation.booleanisDocumented()Checks if this annotation is documented.booleanisInherited()Checks if this annotation is inherited.booleanisSupportedOn(java.lang.annotation.ElementType elementType)Checks if this annotation is supported on the supplied element type.booleanisSupportedOn(java.lang.String elementType)Checks if this annotation is supported on the supplied element type.<T extends java.lang.annotation.Annotation>
AnnotationDescription.Loadable<T>prepare(java.lang.Class<T> annotationType)Links this annotation description to a given annotation type such that it can be loaded.
-
-
-
Field Detail
-
UNDEFINED
@AlwaysNull static final AnnotationDescription.Loadable<?> UNDEFINED
Indicates a nonexistent annotation in a type-safe manner.
-
-
Method Detail
-
getValue
AnnotationValue<?,?> getValue(java.lang.String property)
Returns a value of this annotation.- Parameters:
property- The name of the property being accessed.- Returns:
- The value for the supplied property.
-
getValue
AnnotationValue<?,?> getValue(MethodDescription.InDefinedShape property)
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
<T extends java.lang.annotation.Annotation> AnnotationDescription.Loadable<T> prepare(java.lang.Class<T> annotationType)
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
java.lang.annotation.RetentionPolicy getRetention()
Returns this annotation's retention policy.- Returns:
- This annotation's retention policy.
-
getElementTypes
java.util.Set<java.lang.annotation.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
boolean isSupportedOn(java.lang.annotation.ElementType elementType)
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
boolean isSupportedOn(java.lang.String elementType)
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:
Inherited
-
isDocumented
boolean isDocumented()
Checks if this annotation is documented.- Returns:
trueif this annotation is documented.- See Also:
Documented
-
-