S
- The type of the annotation.public static class AnnotationDescription.ForLoadedAnnotation<S extends Annotation> extends AnnotationDescription.AbstractAnnotationDescription.ForPrepared<S> implements AnnotationDescription.Loadable<S>
AnnotationDescription.AbstractAnnotationDescription.ForPrepared<S extends Annotation>
AnnotationDescription.AbstractAnnotationDescription, AnnotationDescription.EnumerationValue, AnnotationDescription.ForLoadedAnnotation<S extends Annotation>, AnnotationDescription.Loadable<S extends Annotation>
ERROR_MESSAGE
Modifier | Constructor and Description |
---|---|
protected |
ForLoadedAnnotation(S annotation)
Creates a new annotation description for a loaded annotation.
|
Modifier and Type | Method and Description |
---|---|
TypeDescription |
getAnnotationType()
Returns a description of the annotation type of this annotation.
|
Object |
getValue(MethodDescription methodDescription)
Returns the value of the given method for this annotation value.
|
S |
load()
Loads this annotation description.
|
S |
load(ClassLoader classLoader)
Loads this annotation description.
|
static <U extends Annotation> |
of(U annotation)
Creates a description of the given annotation.
|
<T extends Annotation> |
prepare(Class<T> annotationType)
Links this annotation description to a given annotation type such that it can be loaded.
|
static Object |
wrap(Object value,
TypeDescription typeDescription)
A helper method for converting a loaded type into a representation that is also capable of representing
unloaded descriptions of annotation values as specified by
AnnotationDescription . |
loadSilent, loadSilent
equals, getValue, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
loadSilent, loadSilent
getValue
protected ForLoadedAnnotation(S annotation)
annotation
- The annotation to represent.public static <U extends Annotation> AnnotationDescription.Loadable<U> of(U annotation)
U
- The type of the annotation.annotation
- The annotation to be described.public static Object wrap(Object value, TypeDescription typeDescription)
AnnotationDescription
.value
- The loaded value.typeDescription
- The annotation type of the value. This cannot be inferred as enumerations
can implement annotation interfaces and because annotations could be implemented as
an enumeration what creates an ambiguity.AnnotationDescription
.public S load()
AnnotationDescription.Loadable
load
in interface AnnotationDescription.Loadable<S extends Annotation>
public S load(ClassLoader classLoader)
AnnotationDescription.Loadable
load
in interface AnnotationDescription.Loadable<S extends Annotation>
classLoader
- The class loader to be used for loading the annotation's linked types.public Object getValue(MethodDescription methodDescription)
AnnotationDescription
AnnotationDescription
.getValue
in interface AnnotationDescription
methodDescription
- The method for the value to be requested.public <T extends Annotation> AnnotationDescription.Loadable<T> prepare(Class<T> annotationType)
AnnotationDescription
prepare
in interface AnnotationDescription
T
- The type of the annotation.annotationType
- The loaded annotation type of this annotation description.public TypeDescription getAnnotationType()
AnnotationDescription
getAnnotationType
in interface AnnotationDescription
Copyright © 2014–2015. All rights reserved.