Class TypeAnnotations

java.lang.Object
org.apache.bcel.classfile.Attribute
org.apache.bcel.classfile.TypeAnnotations
All Implemented Interfaces:
Cloneable, Iterable<TypeAnnotationEntry>, Node
Direct Known Subclasses:
RuntimeInvisibleTypeAnnotations, RuntimeVisibleTypeAnnotations

public abstract class TypeAnnotations extends Attribute implements Iterable<TypeAnnotationEntry>
Base class for the type annotation attributes, RuntimeVisibleTypeAnnotations and RuntimeInvisibleTypeAnnotations: the annotations written on the types used in a declaration (such as List<@Nullable String>, the supertypes of a class, a throws clause, or the declaration and the bounds of a type parameter as in <T extends @Nullable Object>) or in the code of a method (such as a cast, an instanceof, a new expression or a local variable), which the attributes of the declaration annotations do not hold. They are attributes of a class, a field, a method, a record component or a Code attribute.
Since:
6.14.0
See Also:
  • Constructor Details

    • TypeAnnotations

      public TypeAnnotations(byte annotationType, int nameIndex, int length, TypeAnnotationEntry[] typeAnnotationTable, ConstantPool constantPool, boolean isRuntimeVisible)
      Constructs an instance.
      Parameters:
      annotationType - The subclass type of the attribute.
      nameIndex - Index pointing to the name of the attribute.
      length - Content length in bytes.
      typeAnnotationTable - The actual type annotations.
      constantPool - Array of constants.
      isRuntimeVisible - whether the annotations are visible at runtime.
  • Method Details