gnu.bytecode
Class ExceptionsAttr

java.lang.Object
  extended by gnu.bytecode.Attribute
      extended by gnu.bytecode.ExceptionsAttr

public class ExceptionsAttr
extends Attribute

Represents the contents of a standard "Exceptions" attribute.


Constructor Summary
ExceptionsAttr(Method meth)
          Add a new ExceptionsAttr to a Method.
 
Method Summary
 void assignConstants(ClassType cl)
          Add any needed constant pool entries for this Attribute.
 ClassType[] getExceptions()
          The types of the exceptions in this attr.
 int getLength()
          The size of this Attribute (in bytes) is 2 (for number_of_exception) plus 2 * number_of_exceptions.
 void print(ClassTypeWriter dst)
           
 void setExceptions(ClassType[] excep_types)
          Set the Exceptions attribute to refer to the given exception types.
 void setExceptions(short[] indices, ClassType cl)
          Set the Exceptions attribute to refer to classes whose indices in the constant pool of `cl' are given by `indices'.
 void write(java.io.DataOutputStream dstr)
          Write out the contents of the Attribute.
 
Methods inherited from class gnu.bytecode.Attribute
addToFrontOf, assignConstants, count, get, getContainer, getLengthAll, getName, getNameIndex, getNext, isSkipped, setContainer, setName, setNameIndex, setNext, setSkipped, setSkipped, writeAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionsAttr

public ExceptionsAttr(Method meth)
Add a new ExceptionsAttr to a Method.

Method Detail

setExceptions

public void setExceptions(short[] indices,
                          ClassType cl)
Set the Exceptions attribute to refer to classes whose indices in the constant pool of `cl' are given by `indices'.


setExceptions

public void setExceptions(ClassType[] excep_types)
Set the Exceptions attribute to refer to the given exception types.

Parameters:
excep_types - the types of the exceptions.

assignConstants

public void assignConstants(ClassType cl)
Description copied from class: Attribute
Add any needed constant pool entries for this Attribute. Overridden by sub-classes. Do any other cleanup needed before writing out a .class file.

Overrides:
assignConstants in class Attribute

getLength

public final int getLength()
The size of this Attribute (in bytes) is 2 (for number_of_exception) plus 2 * number_of_exceptions.

Specified by:
getLength in class Attribute

getExceptions

public final ClassType[] getExceptions()
The types of the exceptions in this attr.


write

public void write(java.io.DataOutputStream dstr)
           throws java.io.IOException
Description copied from class: Attribute
Write out the contents of the Attribute. Does not write the 6-byte attribute header.

Specified by:
write in class Attribute
Throws:
java.io.IOException

print

public void print(ClassTypeWriter dst)
Overrides:
print in class Attribute