Class 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 java.lang.String invisibleTag
      The name of the RuntimeInvisibleTypeAnnotations attribute.
      static java.lang.String visibleTag
      The name of the RuntimeVisibleTypeAnnotations attribute.
    • Constructor Summary

      Constructors 
      Constructor Description
      TypeAnnotationsAttribute​(ConstPool cp, java.lang.String attrname, byte[] info)
      Constructs a Runtime(In)VisibleTypeAnnotations_attribute.
    • Field Detail

      • visibleTag

        public static final java.lang.String visibleTag
        The name of the RuntimeVisibleTypeAnnotations attribute.
        See Also:
        Constant Field Values
      • invisibleTag

        public static final java.lang.String invisibleTag
        The name of the RuntimeInvisibleTypeAnnotations attribute.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TypeAnnotationsAttribute

        public TypeAnnotationsAttribute​(ConstPool cp,
                                        java.lang.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 Detail

      • numAnnotations

        public int numAnnotations()
        Returns num_annotations.
      • copy

        public AttributeInfo copy​(ConstPool newCp,
                                  java.util.Map<java.lang.String,​java.lang.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.