Package javassist.bytecode

# Class TypeAnnotationsAttribute

java.lang.Object
javassist.bytecode.AttributeInfo
javassist.bytecode.TypeAnnotationsAttribute

public class TypeAnnotationsAttribute extends AttributeInfo
A class representing `RuntimeVisibleTypeAnnotations` attribute and `RuntimeInvisibleTypeAnnotations` attribute.

Since:
  3.19

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`invisibleTag`
The name of the `RuntimeInvisibleTypeAnnotations` attribute.
`static final String`
`visibleTag`
The name of the `RuntimeVisibleTypeAnnotations` attribute.

## Constructor Summary

Constructors
Constructor
Description
`TypeAnnotationsAttribute(ConstPool cp, String attrname, byte[] info)`
Constructs a `Runtime(In)VisibleTypeAnnotations_attribute`.

## Method Summary

Modifier and Type
Method
Description
`AttributeInfo`
`copy(ConstPool newCp, Map<String,String> classnames)`
Copies this attribute and returns a new copy.
`int`
`numAnnotations()`
Returns `num_annotations`.

### Methods inherited from class javassist.bytecode.AttributeInfo

`get, getConstPool, getName, length, set`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### visibleTag

public static final String visibleTag
The name of the `RuntimeVisibleTypeAnnotations` attribute.

See Also:
  - Constant Field Values

### invisibleTag

public static final String invisibleTag
The name of the `RuntimeInvisibleTypeAnnotations` attribute.

See Also:
  - Constant Field Values

## Constructor Details

### TypeAnnotationsAttribute

public TypeAnnotationsAttribute(ConstPool cp, String attrname, byte[] info)
Constructs a `Runtime(In)VisibleTypeAnnotations_attribute`.

Parameters:
  `cp` - constant pool
  `attrname` - attribute name (`visibleTag` or `invisibleTag`).
  `info` - the contents of this attribute. It does not include `attribute_name_index` or `attribute_length`.

## Method Details

### numAnnotations

public int numAnnotations()
Returns `num_annotations`.

### copy

public AttributeInfo copy(ConstPool newCp, Map<String,String> classnames)
Copies this attribute and returns a new copy.

Overrides:
  `copy` in class `AttributeInfo`
Parameters:
  `newCp` - the constant pool table used by the new copy.
  `classnames` - pairs of replaced and substituted class names.