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 Details

    • visibleTag

      public static final String visibleTag
      The name of the RuntimeVisibleTypeAnnotations attribute.
      See Also:
    • invisibleTag

      public static final String invisibleTag
      The name of the RuntimeInvisibleTypeAnnotations attribute.
      See Also:
  • 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.