Class RecordAttribute


  • public class RecordAttribute
    extends AttributeInfo
    Represents the Record attribute in a class file, which stores information about the record components of a record class.
    • Constructor Detail

      • RecordAttribute

        public RecordAttribute​(ConstPool cp,
                               int nameIndex,
                               java.io.DataInputStream in)
                        throws java.io.IOException
        Constructs a RecordAttribute by reading from a DataInputStream.
        Parameters:
        cp - the constant pool
        nameIndex - the index into the constant pool of the attribute name
        in - the input stream to read from
        Throws:
        java.io.IOException - if an I/O error occurs
      • RecordAttribute

        public RecordAttribute​(ConstPool cp,
                               java.util.List<RecordAttribute.RecordComponentInfo> components)
        Constructs a RecordAttribute with specified components.
        Parameters:
        cp - the constant pool
        attrName - the attribute name
        components - the list of record components
    • Method Detail

      • copy

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

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