gnu.bytecode

Class 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)
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(DataOutputStream dstr)

Methods inherited from class gnu.bytecode.Attribute

addToFrontOf, assignConstants, assignConstants, count, get, getContainer, getLength, getLengthAll, getName, getNameIndex, getNext, isSkipped, print, setContainer, setName, setNameIndex, setNext, setSkipped, setSkipped, write, writeAll

Constructor Details

ExceptionsAttr

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

Method Details

assignConstants

public void assignConstants(ClassType cl)
Overrides:
assignConstants in interface Attribute

getExceptions

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

getLength

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

print

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

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.

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'.

write

public void write(DataOutputStream dstr)
            throws java.io.IOException
Overrides:
write in interface Attribute