Class AttributeInfo

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ConstPool constPool  
      (package private) byte[] info  
      (package private) int name  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AttributeInfo copy​(ConstPool newCp, java.util.Map classnames)
      Makes a copy.
      (package private) static java.util.ArrayList copyAll​(java.util.ArrayList list, ConstPool cp)  
      byte[] get()
      Returns the info field of this attribute_info structure.
      ConstPool getConstPool()
      Returns a constant pool table.
      (package private) static int getLength​(java.util.ArrayList list)  
      java.lang.String getName()
      Returns an attribute name.
      (package private) static void getRefClasses​(java.util.List attributes, java.util.Map classnames)  
      (package private) void getRefClasses​(java.util.Map classnames)  
      int length()
      Returns the length of this attribute_info structure.
      (package private) static AttributeInfo lookup​(java.util.ArrayList list, java.lang.String name)  
      (package private) static AttributeInfo read​(ConstPool cp, java.io.DataInputStream in)  
      (package private) static AttributeInfo remove​(java.util.ArrayList list, java.lang.String name)  
      (package private) void renameClass​(java.lang.String oldname, java.lang.String newname)  
      (package private) static void renameClass​(java.util.List attributes, java.lang.String oldname, java.lang.String newname)  
      (package private) static void renameClass​(java.util.List attributes, java.util.Map classnames)  
      (package private) void renameClass​(java.util.Map classnames)  
      void set​(byte[] newinfo)
      Sets the info field of this attribute_info structure.
      (package private) void write​(java.io.DataOutputStream out)  
      (package private) static void writeAll​(java.util.ArrayList list, java.io.DataOutputStream out)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        int name
      • info

        byte[] info
    • Constructor Detail

      • AttributeInfo

        protected AttributeInfo​(ConstPool cp,
                                int attrname,
                                byte[] attrinfo)
      • AttributeInfo

        protected AttributeInfo​(ConstPool cp,
                                java.lang.String attrname)
      • AttributeInfo

        public AttributeInfo​(ConstPool cp,
                             java.lang.String attrname,
                             byte[] attrinfo)
        Constructs an attribute_info structure.
        Parameters:
        cp - constant pool table
        attrname - attribute name
        attrinfo - info field of attribute_info structure.
      • AttributeInfo

        protected AttributeInfo​(ConstPool cp,
                                int n,
                                java.io.DataInputStream in)
                         throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • read

        static AttributeInfo read​(ConstPool cp,
                                  java.io.DataInputStream in)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getName

        public java.lang.String getName()
        Returns an attribute name.
      • getConstPool

        public ConstPool getConstPool()
        Returns a constant pool table.
      • length

        public int length()
        Returns the length of this attribute_info structure. The returned value is attribute_length + 6.
      • get

        public byte[] get()
        Returns the info field of this attribute_info structure.

        This method is not available if the object is an instance of CodeAttribute.

      • set

        public void set​(byte[] newinfo)
        Sets the info field of this attribute_info structure.

        This method is not available if the object is an instance of CodeAttribute.

      • copy

        public AttributeInfo copy​(ConstPool newCp,
                                  java.util.Map classnames)
        Makes a copy. Class names are replaced according to the given Map object.
        Parameters:
        newCp - the constant pool table used by the new copy.
        classnames - pairs of replaced and substituted class names.
      • write

        void write​(java.io.DataOutputStream out)
            throws java.io.IOException
        Throws:
        java.io.IOException
      • getLength

        static int getLength​(java.util.ArrayList list)
      • lookup

        static AttributeInfo lookup​(java.util.ArrayList list,
                                    java.lang.String name)
      • remove

        static AttributeInfo remove​(java.util.ArrayList list,
                                    java.lang.String name)
      • writeAll

        static void writeAll​(java.util.ArrayList list,
                             java.io.DataOutputStream out)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • copyAll

        static java.util.ArrayList copyAll​(java.util.ArrayList list,
                                           ConstPool cp)
      • renameClass

        void renameClass​(java.lang.String oldname,
                         java.lang.String newname)
      • renameClass

        void renameClass​(java.util.Map classnames)
      • renameClass

        static void renameClass​(java.util.List attributes,
                                java.lang.String oldname,
                                java.lang.String newname)
      • renameClass

        static void renameClass​(java.util.List attributes,
                                java.util.Map classnames)
      • getRefClasses

        void getRefClasses​(java.util.Map classnames)
      • getRefClasses

        static void getRefClasses​(java.util.List attributes,
                                  java.util.Map classnames)