at.dms.classfile
Class Attribute

java.lang.Object
  extended by at.dms.classfile.Attribute
Direct Known Subclasses:
CodeInfo, ConstantValueAttribute, DeprecatedAttribute, ExceptionsAttribute, GenericAttribute, InnerClassTable, LineNumberTable, LocalVariableTable, SourceFileAttribute, SyntheticAttribute

public abstract class Attribute
extends Object

This is the root class of every attribute


Field Summary
static Attribute[] EMPTY
           
 
Constructor Summary
Attribute()
           
 
Method Summary
static Attribute read(DataInput in, ConstantPool cp)
          Constructs an attribute from a class file stream
static Attribute readCodeInfoAttribute(DataInput in, ConstantPool cp, Instruction[] insns)
          Constructs an sub-attribute of CodeInfo from a class file stream
static Attribute readInterfaceOnly(DataInput in, ConstantPool cp)
          Constructs an attribute from a class file stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final Attribute[] EMPTY
Constructor Detail

Attribute

public Attribute()
Method Detail

read

public static Attribute read(DataInput in,
                             ConstantPool cp)
                      throws IOException,
                             ClassFileFormatException
Constructs an attribute from a class file stream

Parameters:
in - the stream to read from
cp - the constant pool
Throws:
IOException - an io problem has occured
ClassFileFormatException - attempt to write a bad classfile info

readInterfaceOnly

public static Attribute readInterfaceOnly(DataInput in,
                                          ConstantPool cp)
                                   throws IOException,
                                          ClassFileFormatException
Constructs an attribute from a class file stream

Parameters:
in - the stream to read from
cp - the constant pool
Throws:
IOException - an io problem has occured
ClassFileFormatException - attempt to write a bad classfile info

readCodeInfoAttribute

public static Attribute readCodeInfoAttribute(DataInput in,
                                              ConstantPool cp,
                                              Instruction[] insns)
                                       throws IOException,
                                              ClassFileFormatException
Constructs an sub-attribute of CodeInfo from a class file stream

Parameters:
in - the stream to read from
cp - the constant pool
insns - (sparse) array of instructions
Throws:
IOException - an io problem has occured
ClassFileFormatException - attempt to write a bad classfile info