Package serp.bytecode

Class UnknownAttribute

  • All Implemented Interfaces:
    BCEntity, VisitAcceptor

    public class UnknownAttribute
    extends Attribute
    An unrecognized attribute; class files are allowed to contain attributes that are not recognized, and the JVM must ignore them.
    • Field Detail

      • _value

        private byte[] _value
    • Constructor Detail

      • UnknownAttribute

        UnknownAttribute​(int nameIndex,
                         Attributes owner)
    • Method Detail

      • getLength

        int getLength()
        Description copied from class: Attribute
        Return the length of the bytecode representation of this attribute in bytes, excluding the name index.
        Overrides:
        getLength in class Attribute
      • getValue

        public byte[] getValue()
        The value is of unknown content, so it is stored as a byte array.
      • setValue

        public void setValue​(byte[] value)
        The value is of unknown content, so it is stored as a byte array.
      • acceptVisit

        public void acceptVisit​(BCVisitor visit)
        Description copied from interface: VisitAcceptor
        Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.
      • read

        void read​(Attribute other)
        Description copied from class: Attribute
        Copy the information from the given attribute to this one. Does nothing by default.
        Overrides:
        read in class Attribute
      • read

        void read​(java.io.DataInput in,
                  int length)
           throws java.io.IOException
        Description copied from class: Attribute
        Read the attribute bytecode from the given stream, up to length bytes, excluding the name index. Does nothing by default.
        Overrides:
        read in class Attribute
        Throws:
        java.io.IOException
      • write

        void write​(java.io.DataOutput out,
                   int length)
            throws java.io.IOException
        Description copied from class: Attribute
        Write the attribute bytecode to the given stream, up to length bytes, excluding the name index. Does nothing by default.
        Overrides:
        write in class Attribute
        Throws:
        java.io.IOException