at.dms.classfile
Class AttributeList

java.lang.Object
  |
  +--at.dms.classfile.AttributeList

class AttributeList
extends java.lang.Object

List of classfile attributes. See VMS 4.7: Attributes


Constructor Summary
(package private) AttributeList()
          Constructs an empty attribute list.
(package private) AttributeList(Attribute att1)
          Constructs a one element attribute list.
(package private) AttributeList(Attribute att1, Attribute att2)
          Constructs a two elements attribute list
(package private) AttributeList(Attribute att1, Attribute att2, Attribute att3)
          Constructs a three elements attribute list
(package private) AttributeList(Attribute att1, Attribute att2, Attribute att3, Attribute att4)
          Constructs a four elements attribute list
(package private) AttributeList(java.io.DataInput in, ConstantPool cp, boolean noCode)
          Constructs an attribute list from a class file stream.
(package private) AttributeList(java.io.DataInput in, ConstantPool cp, Instruction[] instructions)
          Constructs an sub-attribute list of CodeInfo from a class file stream.
 
Method Summary
(package private)  void add(Attribute attr)
          Adds an attribute to the list of attributes
(package private)  Attribute get(int tag)
          Return the first attribute for this tag
(package private)  int getSize()
          Returns the space in bytes used by this attribute in the classfile
(package private)  boolean remove(int tag)
          Removes an attribute from the list of attributes
(package private)  void resolveConstants(ConstantPool cp)
          Insert or check location of constant values in constant pool
(package private)  void write(ConstantPool cp, java.io.DataOutput out)
          Write this class into the the file (out) getting data position from the constant pool
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeList

AttributeList()
Constructs an empty attribute list.

AttributeList

AttributeList(Attribute att1)
Constructs a one element attribute list.

AttributeList

AttributeList(Attribute att1,
              Attribute att2)
Constructs a two elements attribute list

AttributeList

AttributeList(Attribute att1,
              Attribute att2,
              Attribute att3)
Constructs a three elements attribute list

AttributeList

AttributeList(Attribute att1,
              Attribute att2,
              Attribute att3,
              Attribute att4)
Constructs a four elements attribute list

AttributeList

AttributeList(java.io.DataInput in,
              ConstantPool cp,
              boolean noCode)
        throws java.io.IOException,
               ClassFileFormatException
Constructs an attribute list from a class file stream.
Parameters:
in - The stream to read from.
cp - The constant pool.
noCode - Do not read code attribute.
Throws:
java.io.IOException - An io problem has occured.
ClassFileFormatException - Attempt to read a bad classfile info.

AttributeList

AttributeList(java.io.DataInput in,
              ConstantPool cp,
              Instruction[] instructions)
        throws java.io.IOException,
               ClassFileFormatException
Constructs an sub-attribute list of CodeInfo from a class file stream.
Parameters:
in - the stream to read from
cp - the constant pool
instructions - (sparse) array of instructions
Throws:
java.io.IOException - an io problem has occured
ClassFileFormatException - attempt to write a bad classfile info
Method Detail

get

final Attribute get(int tag)
Return the first attribute for this tag
Parameters:
tag - the tag that identifies the attribute

add

final void add(Attribute attr)
Adds an attribute to the list of attributes
Parameters:
attr - the attribute to add to the list

remove

final boolean remove(int tag)
Removes an attribute from the list of attributes
Parameters:
tag - the tag that identifies the attribute
Returns:
true iff an attribute with given tag was in the list

getSize

int getSize()
Returns the space in bytes used by this attribute in the classfile

resolveConstants

void resolveConstants(ConstantPool cp)
                throws ClassFileFormatException
Insert or check location of constant values in constant pool
Parameters:
cp - the constant pool for this class

write

void write(ConstantPool cp,
           java.io.DataOutput out)
     throws java.io.IOException,
            ClassFileFormatException
Write this class into the the file (out) getting data position from the constant pool
Parameters:
cp - the constant pool that contain all data
out - the file where to write this object info
Throws:
java.io.IOException - an io problem has occured
ClassFileFormatException - attempt to write a bad classfile info