Class AnnotationDescription.ForLoadedAnnotation<S extends Annotation>
java.lang.Object
net.bytebuddy.description.annotation.AnnotationDescription.AbstractBase
net.bytebuddy.description.annotation.AnnotationDescription.ForLoadedAnnotation<S>
- Type Parameters:
S- The type of the annotation.
- All Implemented Interfaces:
AnnotationDescription, AnnotationDescription.Loadable<S>
- Enclosing interface:
AnnotationDescription
public static class AnnotationDescription.ForLoadedAnnotation<S extends Annotation>
extends AnnotationDescription.AbstractBase
implements AnnotationDescription.Loadable<S>
A description of an already loaded annotation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface AnnotationDescription
AnnotationDescription.AbstractBase, AnnotationDescription.AnnotationInvocationHandler<T>, AnnotationDescription.Builder, AnnotationDescription.ForLoadedAnnotation<S>, AnnotationDescription.Latent, AnnotationDescription.Loadable<S>, AnnotationDescription.RenderingDispatcher -
Field Summary
Fields inherited from interface AnnotationDescription
UNDEFINED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForLoadedAnnotation(S annotation) Creates a new annotation description for a loaded annotation. -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationValue<?, ?> Transforms an annotation property to an annotation value.Returns a description of the annotation type of this annotation.AnnotationValue<?, ?> getValue(MethodDescription.InDefinedShape property) Returns a value of this annotation.load()Loads this annotation description.static <U extends Annotation>
AnnotationDescription.Loadable<U> of(U annotation) Creates a description of the given annotation.<T extends Annotation>
AnnotationDescription.Loadable<T> Links this annotation description to a given annotation type such that it can be loaded.Methods inherited from class AnnotationDescription.AbstractBase
equals, getElementTypes, getRetention, getValue, hashCode, isDocumented, isInherited, isSupportedOn, isSupportedOn, toStringMethods inherited from interface AnnotationDescription
getElementTypes, getRetention, getValue, isDocumented, isInherited, isSupportedOn, isSupportedOn
-
Constructor Details
-
ForLoadedAnnotation
Creates a new annotation description for a loaded annotation.- Parameters:
annotation- The annotation to represent.
-
-
Method Details
-
of
Creates a description of the given annotation.- Type Parameters:
U- The type of the annotation.- Parameters:
annotation- The annotation to be described.- Returns:
- A description of the given annotation.
-
load
Loads this annotation description. This causes all classes referenced by the annotation value to be loaded. Without specifying a class loader, the annotation's class loader which was used to prepare this instance is used.- Specified by:
loadin interfaceAnnotationDescription.Loadable<S extends Annotation>- Returns:
- A loaded version of this annotation description.
-
asValue
Transforms an annotation property to an annotation value.- Parameters:
value- The annotations value.type- The annotation's type.- Returns:
- An annotation value representation.
-
getValue
Returns a value of this annotation.- Specified by:
getValuein interfaceAnnotationDescription- Parameters:
property- The property being accessed.- Returns:
- The value for the supplied property.
-
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.- Specified by:
preparein interfaceAnnotationDescription- 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.
-
getAnnotationType
Returns a description of the annotation type of this annotation.- Specified by:
getAnnotationTypein interfaceAnnotationDescription- Returns:
- A description of the annotation type of this annotation.
-