---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 19 Edition"
java_version: 19
chapter: "Chapter 4. The class File Format"
section: "4.7.21"
heading: "4.7.21. The RuntimeInvisibleTypeAnnotations Attribute"
parent: "4.7. Attributes"
source: https://docs.oracle.com/javase/specs/jvms/se19/html/jvms-4.html#jvms-4.7.21
id: "4.7.21"
url: https://jvm.obfuscated.software/jvms/se19/4.7.21.html
raw: https://jvm.obfuscated.software/jvms/se19/4.7.21.md
---

# 4.7.21. The `RuntimeInvisibleTypeAnnotations` Attribute

The `RuntimeInvisibleTypeAnnotations` attribute is an variable-length attribute in the `attributes` table of a `ClassFile`, `field_info`, `method_info`, or `record_component_info` structure, or `Code` attribute ([§4.1](4.1.md), [§4.5](4.5.md), [§4.6](4.6.md), [§4.7.30](4.7.30.md), [§4.7.3](4.7.3.md)). The `RuntimeInvisibleTypeAnnotations` attribute stores run-time invisible annotations on types used in the corresponding declaration of a class, field, method, or record component, or in an expression in the corresponding method body. The `RuntimeInvisibleTypeAnnotations` attribute also stores annotations on type parameter declarations of generic classes, interfaces, methods, and constructors.

There may be at most one `RuntimeInvisibleTypeAnnotations` attribute in the `attributes` table of a `ClassFile`, `field_info`, `method_info`, or `record_component_info` structure, or `Code` attribute.

An `attributes` table contains a `RuntimeInvisibleTypeAnnotations` attribute only if types are annotated in kinds of declaration or expression that correspond to the parent structure or attribute of the `attributes` table.

The `RuntimeInvisibleTypeAnnotations` attribute has the following format:

```
RuntimeInvisibleTypeAnnotations_attribute {
    u2              attribute_name_index;
    u4              attribute_length;
    u2              num_annotations;
    type_annotation annotations[num_annotations];
}
```

The items of the `RuntimeInvisibleTypeAnnotations_attribute` structure are as follows:

- **attribute_name_index**

  The value of the `attribute_name_index` item must be a valid index into the `constant_pool` table. The `constant_pool` entry at that index must be a `CONSTANT_Utf8_info` structure representing the string "`RuntimeInvisibleTypeAnnotations`".

- **attribute_length**

  The value of the `attribute_length` item indicates the length of the attribute, excluding the initial six bytes.

- **num_annotations**

  The value of the `num_annotations` item gives the number of run-time invisible type annotations represented by the structure.

- **annotations[]**

  Each entry in the `annotations` table represents a single run-time invisible annotation on a type used in a declaration or expression. The `type_annotation` structure is specified in [§4.7.20](4.7.20.md).
