org.apache.bcel.classfile
Class ExceptionTable
- Cloneable, Node, Serializable
public final class ExceptionTable
This class represents the table of exceptions that are thrown by a
method. This attribute may be used once per method. The name of
this class is ExceptionTable for historical reasons; The
Java Virtual Machine Specification, Second Edition defines this
attribute using the name Exceptions (which is inconsistent
with the other classes).
$Id: ExceptionTable.java,v 1.2 2002/03/11 16:16:35 mdahm Exp $
accept , addAttributeReader , clone , copy , dump , getConstantPool , getLength , getNameIndex , getTag , readAttribute , removeAttributeReader , setConstantPool , setLength , setNameIndex , toString |
ExceptionTable
public ExceptionTable(int name_index,
int length,
int[] exception_index_table,
ConstantPool constant_pool)
name_index
- Index in constant poollength
- Content length in bytesexception_index_table
- Table of indices in constant poolconstant_pool
- Array of constants
ExceptionTable
public ExceptionTable(ExceptionTable c)
Initialize from another object. Note that both objects use the same
references (shallow copy). Use copy() for a physical copy.
accept
public void accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class. I.e., the hierarchy of methods,
fields, attributes, etc. spawns a tree of objects.
- accept in interface Node
- accept in interface Attribute
dump
public final void dump(DataOutputStream file)
throws IOException
Dump exceptions attribute to file stream in binary format.
- dump in interface Attribute
file
- Output file stream
getExceptionIndexTable
public final int[] getExceptionIndexTable()
- Array of indices into constant pool of thrown exceptions.
getExceptionNames
public final String[] getExceptionNames()
- class names of thrown exceptions
getNumberOfExceptions
public final int getNumberOfExceptions()
- Length of exception table.
setExceptionIndexTable
public final void setExceptionIndexTable(int[] exception_index_table)
toString
public final String toString()
- toString in interface Attribute
- String representation, i.e., a list of thrown exceptions.