S - The type of the annotation.public static class AnnotationDescription.ForLoadedAnnotation<S extends java.lang.annotation.Annotation> extends AnnotationDescription.AbstractBase.ForPrepared<S>
AnnotationDescription.AbstractBase.ForPrepared<S extends java.lang.annotation.Annotation>AnnotationDescription.AbstractBase, AnnotationDescription.AnnotationInvocationHandler<T extends java.lang.annotation.Annotation>, AnnotationDescription.Builder, AnnotationDescription.ForLoadedAnnotation<S extends java.lang.annotation.Annotation>, AnnotationDescription.Latent, AnnotationDescription.Loadable<S extends java.lang.annotation.Annotation>| Modifier and Type | Field and Description |
|---|---|
private S |
annotation
The represented annotation value.
|
private java.lang.Class<S> |
annotationType
The annotation's loaded type which might be loaded by a different class loader than the value's
annotation type but must be structurally equal to it.
|
UNDEFINED| Modifier | Constructor and Description |
|---|---|
protected |
ForLoadedAnnotation(S annotation)
Creates a new annotation description for a loaded annotation.
|
private |
ForLoadedAnnotation(S annotation,
java.lang.Class<S> annotationType)
Creates a new annotation description for a loaded annotation.
|
| Modifier and Type | Method and Description |
|---|---|
private static java.util.Map<java.lang.String,AnnotationValue<?,?>> |
asValue(java.lang.annotation.Annotation annotation)
Extracts the annotation values of an annotation into a property map.
|
static AnnotationValue<?,?> |
asValue(java.lang.Object value,
java.lang.Class<?> type)
Transforms an annotation property to an annotation value.
|
TypeDescription |
getAnnotationType()
Returns a description of the annotation type of this annotation.
|
AnnotationValue<?,?> |
getValue(MethodDescription.InDefinedShape property)
Returns the value of this annotation.
|
S |
load()
Loads this annotation description.
|
static <U extends java.lang.annotation.Annotation> |
of(U annotation)
Creates a description of the given annotation.
|
<T extends java.lang.annotation.Annotation> |
prepare(java.lang.Class<T> annotationType)
Links this annotation description to a given annotation type such that it can be loaded.
|
loadSilentequals, getElementTypes, getRetention, hashCode, isDocumented, isInherited, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetElementTypes, getRetention, isDocumented, isInheritedprivate final S extends java.lang.annotation.Annotation annotation
private final java.lang.Class<S extends java.lang.annotation.Annotation> annotationType
protected ForLoadedAnnotation(S annotation)
annotation - The annotation to represent.private ForLoadedAnnotation(S annotation, java.lang.Class<S> annotationType)
annotation - The annotation to represent.annotationType - The annotation's loaded type which might be loaded by a different class loader than the value's
annotation type but must be structurally equal to it.public static <U extends java.lang.annotation.Annotation> AnnotationDescription.Loadable<U> of(U annotation)
U - The type of the annotation.annotation - The annotation to be described.public S load() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException - If any linked classes of the annotation cannot be loaded.private static java.util.Map<java.lang.String,AnnotationValue<?,?>> asValue(java.lang.annotation.Annotation annotation)
annotation - The annotation to convert.public static AnnotationValue<?,?> asValue(java.lang.Object value, java.lang.Class<?> type)
type - The annotation's type.value - The annotations value.public AnnotationValue<?,?> getValue(MethodDescription.InDefinedShape property)
property - The property being accessed.public <T extends java.lang.annotation.Annotation> AnnotationDescription.Loadable<T> prepare(java.lang.Class<T> annotationType)
T - The type of the annotation.annotationType - The loaded annotation type of this annotation description.public TypeDescription getAnnotationType()