annotation structure (JVMS 4.7.16) or part of a type_annotation structure (JVMS 4.7.20). This model indicates the
interface of the annotation and a set of element-value pairs.
This model can reconstruct an annotation, given the location of the modeled
structure in the class file and the definition of the annotation
interface.
Two Annotation objects should be compared using the equals method.
API Note
For Java programs, the location of the modeled structure indicates the source code element or type (JLS 9.7.4) on which the reconstructed annotation appears, and the annotation interface definition determines whether the reconstructed annotation has elements with default values (JLS 9.6.2), and whether the reconstructed annotation is a container annotation for multiple annotations (JLS 9.7.5).
java.lang.annotation.Annotation , Annotations in core reflection, TypeAnnotation, RuntimeVisibleAnnotationsAttribute, RuntimeInvisibleAnnotationsAttribute, RuntimeVisibleParameterAnnotationsAttribute, RuntimeInvisibleParameterAnnotationsAttribute
| Modifier and Type | Method and Description |
|---|---|
| public Utf8Entry | Returns: the constant pool entry holding the descriptor string of the annotation interfaceReturns the constant pool entry holding the descriptor string of the annotation interface. |
| public default ClassDesc | Returns: the annotation interface, as a symbolic descriptorReturns the annotation interface, as a symbolic descriptor. |
| public List | Returns: the element-value pairs of the annotationReturns the element-value pairs of the annotation. |
| public static Annotation | Returns: an annotationthe constant pool entry holding the descriptor string
of the annotation interface annotationClass, List<AnnotationElement> the element-value pairs of the annotation elements)Returns an annotation. |
| public static Annotation | Returns: an annotationthe constant pool entry holding the descriptor string
of the annotation interface annotationClass, AnnotationElement... the element-value pairs of the annotation elements)Returns an annotation. |
| public static Annotation | Returns: an annotationthe descriptor of the annotation interface annotationClass, List<AnnotationElement> the element-value pairs of the annotation elements)Returns an annotation. |
| public static Annotation | Returns: an annotationthe descriptor of the annotation interface annotationClass, AnnotationElement... the element-value pairs of the annotation elements)Returns an annotation. |
| className | back to summary |
|---|---|
| public Utf8Entry className() Returns the constant pool entry holding the descriptor string of the annotation interface.
| |
| classSymbol | back to summary |
|---|---|
| public default ClassDesc classSymbol() Returns the annotation interface, as a symbolic descriptor.
| |
| elements | back to summary |
|---|---|
| public List Returns the element-value pairs of the annotation.
| |
| of | back to summary |
|---|---|
| public static Annotation of(Utf8Entry annotationClass, List<AnnotationElement> elements) Returns an annotation.
| |
| of | back to summary |
|---|---|
| public static Annotation of(Utf8Entry annotationClass, AnnotationElement... elements) Returns an annotation.
| |
| of | back to summary |
|---|---|
| public static Annotation of(ClassDesc annotationClass, List<AnnotationElement> elements) Returns an annotation.
| |
| of | back to summary |
|---|---|
| public static Annotation of(ClassDesc annotationClass, AnnotationElement... elements) Returns an annotation.
| |