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.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models an annotation on a declaration.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the class of the annotation.default ClassDesc
Returns the class of the annotation, as a symbolic descriptor.elements()
Returns the elements of the annotation.static AnnotationPREVIEW
of
(Utf8EntryPREVIEW annotationClass, AnnotationElementPREVIEW... elements) Returns an annotation.static AnnotationPREVIEW
Returns an annotation.static AnnotationPREVIEW
of
(ClassDesc annotationClass, AnnotationElementPREVIEW... elements) Returns an annotation.static AnnotationPREVIEW
of
(ClassDesc annotationClass, List<AnnotationElementPREVIEW> elements) Returns an annotation.Methods declared in interface java.lang.classfile.WritableElementPREVIEW
writeTo
-
Method Details
-
className
-
classSymbol
Returns the class of the annotation, as a symbolic descriptor.- Returns:
- the class of the annotation, as a symbolic descriptor
-
elements
List<AnnotationElementPREVIEW> 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 annotationelements
- the elements of the annotation- Returns:
- an annotation
-
of
Returns an annotation.- Parameters:
annotationClass
- the class of the annotationelements
- the elements of the annotation- Returns:
- an annotation
-
of
Returns an annotation.- Parameters:
annotationClass
- the class of the annotationelements
- the elements of the annotation- Returns:
- an annotation
-
of
Returns an annotation.- Parameters:
annotationClass
- the class of the annotationelements
- the elements of the annotation- Returns:
- an annotation
-
Annotation
when preview features are enabled.