Interface AnnotationDefaultAttribute

All Superinterfaces:
AttributePREVIEW<AnnotationDefaultAttributePREVIEW>, ClassFileElementPREVIEW, MethodElementPREVIEW

public sealed interface AnnotationDefaultAttribute extends AttributePREVIEW<AnnotationDefaultAttributePREVIEW>, MethodElementPREVIEW
AnnotationDefaultAttribute is a preview API of the Java platform.
Programs can only use AnnotationDefaultAttribute when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models the AnnotationDefault attribute (JVMS 4.7.22), which can appear on methods of annotation types, and records the default value 9.6.2 for the element corresponding to this method. Delivered as a MethodElementPREVIEW when traversing the elements of a MethodModelPREVIEW.

The attribute does not permit multiple instances in a given location. Subsequent occurrence of the attribute takes precedence during the attributed element build or transformation.

The attribute was introduced in the Java SE Platform version 5.0.

Since:
22
  • Method Details

    • defaultValue

      AnnotationValuePREVIEW defaultValue()
      Returns the default value of the annotation type element represented by this method.
      Returns:
      the default value of the annotation type element represented by this method
    • of

      Returns an AnnotationDefault attribute.
      Parameters:
      annotationDefault - the default value of the annotation type element
      Returns:
      an AnnotationDefault attribute