Class TypeAnnotationsAttribute


  • public class TypeAnnotationsAttribute
    extends AttributeInfo
    A class representing RuntimeVisibleTypeAnnotations attribute and RuntimeInvisibleTypeAnnotations attribute.
    Since:
    3.19
    • 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.
      • TypeAnnotationsAttribute

        TypeAnnotationsAttribute​(ConstPool cp,
                                 int n,
                                 java.io.DataInputStream in)
                          throws java.io.IOException
        Parameters:
        n - the attribute name.
        Throws:
        java.io.IOException
    • Method Detail

      • numAnnotations

        public int numAnnotations()
        Returns num_annotations.
      • copy

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

        void renameClass​(java.lang.String oldname,
                         java.lang.String newname)
        Overrides:
        renameClass in class AttributeInfo
        Parameters:
        oldname - a JVM class name.
        newname - a JVM class name.