APIdia Launch Partner
Top Description Methods
java.lang.classfile.attribute

public sealed Interface RuntimeInvisibleAnnotationsAttribute

extends Attribute<RuntimeInvisibleAnnotationsAttribute>, ClassElement, MethodElement, FieldElement
permits BoundRuntimeInvisibleAnnotationsAttribute, UnboundRuntimeInvisibleAnnotationsAttribute
Known Direct Implementers
jdk.internal.classfile.impl.BoundAttribute.BoundRuntimeInvisibleAnnotationsAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundRuntimeInvisibleAnnotationsAttribute
Annotations
@SuppressWarnings:doclint:reference
Imports
java.lang.annotation.ElementType, .RetentionPolicy, java.lang.classfile.*, .AttributeMapper.AttributeStability, java.lang.reflect.AnnotatedElement, java.util.List, jdk.internal.classfile.impl.BoundAttribute, .UnboundAttribute

Models the RuntimeInvisibleAnnotations attribute (JVMS 4.7.17), which stores declaration annotations on this structure that are visible to class file consumers but are not visible to core reflection.

This attribute appears on classes, fields, methods, and record components, and does not permit multiple instances in one structure. It has a data dependency on the constant pool.

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

Since
24
Java Virtual Machine Specification
4.7.17 The RuntimeInvisibleAnnotations Attribute
See Also
Attributes#runtimeInvisibleAnnotations(), java.compiler/javax.lang.model.element.Element, ElementType, RetentionPolicy#CLASS

Method Summary

Modifier and TypeMethod and Description
public List<Annotation>

Returns:

the run-time invisible declaration annotations on this structure
annotations
()

Returns the run-time invisible declaration annotations on this structure.

public static RuntimeInvisibleAnnotationsAttribute

Returns:

a RuntimeInvisibleAnnotations attribute
of
(List<Annotation>
the annotations
annotations
)

Returns a RuntimeInvisibleAnnotations attribute.

public static RuntimeInvisibleAnnotationsAttribute

Returns:

a RuntimeInvisibleAnnotations attribute
of
(Annotation...
the annotations
annotations
)

Returns a RuntimeInvisibleAnnotations attribute.

Inherited from java.lang.classfile.Attribute:
attributeMapperattributeName

Method Detail

annotationsback to summary
public List<Annotation> annotations()

Returns the run-time invisible declaration annotations on this structure.

Returns:List<Annotation>

the run-time invisible declaration annotations on this structure

ofback to summary
public static RuntimeInvisibleAnnotationsAttribute of(List<Annotation> annotations)

Returns a RuntimeInvisibleAnnotations attribute.

Parameters
annotations:List<Annotation>

the annotations

Returns:RuntimeInvisibleAnnotationsAttribute

a RuntimeInvisibleAnnotations attribute

Exceptions
IllegalArgumentException:
if the number of annotations exceeds the limit of u2
ofback to summary
public static RuntimeInvisibleAnnotationsAttribute of(Annotation... annotations)

Returns a RuntimeInvisibleAnnotations attribute.

Parameters
annotations:Annotation[]

the annotations

Returns:RuntimeInvisibleAnnotationsAttribute

a RuntimeInvisibleAnnotations attribute

Exceptions
IllegalArgumentException:
if the number of annotations exceeds the limit of u2