Top Description Methods
java.lang.classfile.attribute

public sealed Interface RuntimeVisibleTypeAnnotationsAttribute

extends Attribute<RuntimeVisibleTypeAnnotationsAttribute>, ClassElement, MethodElement, FieldElement, CodeElement
Known Direct Implementers
jdk.internal.classfile.impl.BoundAttribute.BoundRuntimeVisibleTypeAnnotationsAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundRuntimeVisibleTypeAnnotationsAttribute
Annotations
@PreviewFeature
feature:CLASSFILE_API
Imports
java.util.List, java.lang.classfile.Attribute, .ClassElement, .CodeElement, .FieldElement, .MethodElement, .TypeAnnotation, jdk.internal.classfile.impl.BoundAttribute, .UnboundAttribute, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use RuntimeVisibleTypeAnnotationsAttribute 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 RuntimeVisibleTypeAnnotations attribute 4.7.20, which can appear on classes, methods, fields, and code attributes. Delivered as a java.lang.classfile.ClassElement, java.lang.classfile.FieldElement, java.lang.classfile.MethodElement, or CodeElement when traversing the corresponding model type.

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 8.

Since
22

Method Summary

Modifier and TypeMethod and Description
public List<TypeAnnotation>

Returns:

the runtime-visible type annotations on parts of this class, field, or method
annotations
()

Returns the runtime-visible type annotations on parts of this class, field, or method.

public static RuntimeVisibleTypeAnnotationsAttribute

Returns:

a RuntimeVisibleTypeAnnotations attribute
of
(List<TypeAnnotation>
the annotations
annotations
)

Returns a RuntimeVisibleTypeAnnotations attribute.

public static RuntimeVisibleTypeAnnotationsAttribute

Returns:

a RuntimeVisibleTypeAnnotations attribute
of
(TypeAnnotation...
the annotations
annotations
)

Returns a RuntimeVisibleTypeAnnotations attribute.

Inherited from java.lang.classfile.Attribute:
attributeMapperattributeName

Method Detail

annotationsback to summary
public List<TypeAnnotation> annotations()

Returns the runtime-visible type annotations on parts of this class, field, or method.

Returns:List<TypeAnnotation>

the runtime-visible type annotations on parts of this class, field, or method

ofback to summary
public static RuntimeVisibleTypeAnnotationsAttribute of(List<TypeAnnotation> annotations)

Returns a RuntimeVisibleTypeAnnotations attribute.

Parameters
annotations:List<TypeAnnotation>

the annotations

Returns:RuntimeVisibleTypeAnnotationsAttribute

a RuntimeVisibleTypeAnnotations attribute

ofback to summary
public static RuntimeVisibleTypeAnnotationsAttribute of(TypeAnnotation... annotations)

Returns a RuntimeVisibleTypeAnnotations attribute.

Parameters
annotations:TypeAnnotation[]

the annotations

Returns:RuntimeVisibleTypeAnnotationsAttribute

a RuntimeVisibleTypeAnnotations attribute