Interface Annotation

All Superinterfaces:
ClassfileElement, WritableElement<Annotation>
All Known Subinterfaces:
TypeAnnotation
All Known Implementing Classes:
AnnotationImpl, UnboundAttribute.UnboundTypeAnnotation

public sealed interface Annotation extends WritableElement<Annotation> permits TypeAnnotation, AnnotationImpl
Models an annotation on a declaration.
See Also:
  • Method Details

    • className

      Utf8Entry className()
      Returns the class of the annotation.
      Returns:
      the class of the annotation
    • classSymbol

      default ClassDesc classSymbol()
      Returns the class of the annotation, as a symbolic descriptor.
      Returns:
      the class of the annotation, as a symbolic descriptor
    • elements

      List<AnnotationElement> elements()
      Returns the elements of the annotation.
      Returns:
      the elements of the annotation
    • of

      static Annotation of(Utf8Entry annotationClass, List<AnnotationElement> elements)
      Returns an annotation.
      Parameters:
      annotationClass - the class of the annotation
      elements - the elements of the annotation
      Returns:
      an annotation
    • of

      static Annotation of(Utf8Entry annotationClass, AnnotationElement... elements)
      Returns an annotation.
      Parameters:
      annotationClass - the class of the annotation
      elements - the elements of the annotation
      Returns:
      an annotation
    • of

      static Annotation of(ClassDesc annotationClass, List<AnnotationElement> elements)
      Returns an annotation.
      Parameters:
      annotationClass - the class of the annotation
      elements - the elements of the annotation
      Returns:
      an annotation
    • of

      static Annotation of(ClassDesc annotationClass, AnnotationElement... elements)
      Returns an annotation.
      Parameters:
      annotationClass - the class of the annotation
      elements - the elements of the annotation
      Returns:
      an annotation