Interface Annotation

All Superinterfaces:
ClassFileElementPREVIEW, WritableElementPREVIEW<AnnotationPREVIEW>
All Known Subinterfaces:
TypeAnnotationPREVIEW

public sealed interface Annotation extends WritableElementPREVIEW<AnnotationPREVIEW> permits TypeAnnotationPREVIEW (not exhaustive)
Annotation is a preview API of the Java platform.
Programs can only use Annotation when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models an annotation on a declaration.
Sealed Class Hierarchy Graph:
Sealed class hierarchy graph for AnnotationSealed class hierarchy graph for Annotation
Since:
22
See Also:
  • Method Details

    • className

      Utf8EntryPREVIEW 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

      Returns the elements of the annotation.
      Returns:
      the elements of the annotation
    • of

      static AnnotationPREVIEW of(Utf8EntryPREVIEW annotationClass, List<AnnotationElementPREVIEW> elements)
      Returns an annotation.
      Parameters:
      annotationClass - the class of the annotation
      elements - the elements of the annotation
      Returns:
      an annotation
    • of

      static AnnotationPREVIEW of(Utf8EntryPREVIEW annotationClass, AnnotationElementPREVIEW... elements)
      Returns an annotation.
      Parameters:
      annotationClass - the class of the annotation
      elements - the elements of the annotation
      Returns:
      an annotation
    • of

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

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