Interface AnnotationDefaultAttribute

All Superinterfaces:
Attribute<AnnotationDefaultAttribute>, ClassFileElement, MethodElement

public sealed interface AnnotationDefaultAttribute extends Attribute<AnnotationDefaultAttribute>, MethodElement
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 MethodElement when traversing the elements of a MethodModel.

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:
24
  • Method Details

    • defaultValue

      AnnotationValue 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

      static AnnotationDefaultAttribute of(AnnotationValue annotationDefault)
      Returns an AnnotationDefault attribute.
      Parameters:
      annotationDefault - the default value of the annotation type element
      Returns:
      an AnnotationDefault attribute