Top Description Fields Constructors Methods
org.aspectj.apache.bcel.classfile

public final Class ExceptionTable

extends Attribute
Class Inheritance
Imports
java.io.DataInputStream, .DataOutputStream, .IOException, org.aspectj.apache.bcel.Constants

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).
Author
M. Dahm
Version
$Id: ExceptionTable.java,v 1.5 2009/09/15 19:40:12 aclement Exp $
See Also
Code

Field Summary

Modifier and TypeField and Description
private int[]
private int
Inherited from org.aspectj.apache.bcel.classfile.Attribute:
cpoollengthnameIndexNoAttributestag

Constructor Summary

AccessConstructor and Description
public
ExceptionTable(ExceptionTable c)

Initialize from another object.

public
ExceptionTable(int
Index in constant pool
name_index
,
int
Content length in bytes
length
,
int[]
Table of indices in constant pool
exception_index_table
,
ConstantPool
Array of constants
constant_pool
)

pack-priv
ExceptionTable(int
Index in constant pool
name_index
,
int
Content length in bytes
length
,
DataInputStream
Input stream
file
,
ConstantPool
Array of constants
constant_pool
)

Construct object from file stream.

Method Summary

Modifier and TypeMethod and Description
public void
accept(ClassVisitor
Visitor object
v
)

Implements abstract org.aspectj.apache.bcel.classfile.Attribute.accept.

Implements org.aspectj.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
public final void
dump(DataOutputStream
Output file stream
file
)

Overrides org.aspectj.apache.bcel.classfile.Attribute.dump.

Dump exceptions attribute to file stream in binary format.
public final int[]

Returns:

Array of indices into constant pool of thrown exceptions.
getExceptionIndexTable
()

public final String[]

Returns:

class names of thrown exceptions
getExceptionNames
()

public final int

Returns:

Length of exception table.
getNumberOfExceptions
()

public final void
setExceptionIndexTable(int[]
Also redefines number_of_exceptions according to table length.
exception_index_table
)

public final String

Returns:

String representation, i.e., a list of thrown exceptions.
toString
()

Overrides org.aspectj.apache.bcel.classfile.Attribute.toString.

Returns a string representation of the object.
Inherited from org.aspectj.apache.bcel.classfile.Attribute:
getConstantPoolgetLengthgetNamegetNameIndexgetTagreadAttribute

Field Detail

exception_index_tableback to summary
private int[] exception_index_table
number_of_exceptionsback to summary
private int number_of_exceptions

Constructor Detail

ExceptionTableback to summary
public ExceptionTable(ExceptionTable c)

Initialize from another object. Note that both objects use the same references (shallow copy). Use copy() for a physical copy.

ExceptionTableback to summary
public ExceptionTable(int name_index, int length, int[] exception_index_table, ConstantPool constant_pool)
Parameters
name_index:int

Index in constant pool

length:int

Content length in bytes

exception_index_table:int[]

Table of indices in constant pool

constant_pool:ConstantPool

Array of constants

ExceptionTableback to summary
pack-priv ExceptionTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException

Construct object from file stream.

Parameters
name_index:int

Index in constant pool

length:int

Content length in bytes

file:DataInputStream

Input stream

constant_pool:ConstantPool

Array of constants

Method Detail

acceptback to summary
public void accept(ClassVisitor v)

Implements abstract org.aspectj.apache.bcel.classfile.Attribute.accept.

Implements org.aspectj.apache.bcel.classfile.Node.accept.

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.

Parameters
v:ClassVisitor

Visitor object

Annotations
@Override
dumpback to summary
public final void dump(DataOutputStream file) throws IOException

Overrides org.aspectj.apache.bcel.classfile.Attribute.dump.

Dump exceptions attribute to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
getExceptionIndexTableback to summary
public final int[] getExceptionIndexTable()
Returns:int[]

Array of indices into constant pool of thrown exceptions.

getExceptionNamesback to summary
public final String[] getExceptionNames()
Returns:String[]

class names of thrown exceptions

getNumberOfExceptionsback to summary
public final int getNumberOfExceptions()
Returns:int

Length of exception table.

setExceptionIndexTableback to summary
public final void setExceptionIndexTable(int[] exception_index_table)
Parameters
exception_index_table:int[]

Also redefines number_of_exceptions according to table length.

toStringback to summary
public final String toString()

Overrides org.aspectj.apache.bcel.classfile.Attribute.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

String representation, i.e., a list of thrown exceptions.

Annotations
@Override