public final class ExceptionsAttribute_info extends Attribute_info
Method_info
structure. The Exceptions
attribute indicates which checked exceptions a method may throw. There must be
exactly one Exceptions attribute in each method_info structure.The Exceptions attribute has the following format:
Exceptions_attribute { u2 attribute_name_index; u4 attribute_length; u2 number_of_exceptions; u2 exception_index_table[number_of_exceptions]; }The value of the number_of_exceptions item indicates the number of entries in the exception_index_table.
Each nonzero value in the exception_index_table array must be a valid index
into the constant_pool table. For each table item, if
exception_index_table[i] != 0 , where 0 < i < number_of_exceptions,
then the constant_pool entry at index exception_index_table[i] must be a
CONSTANT_Class_info
structure representing
a class type that this method is declared to throw -- see DeclaredExceptionTable
.
Modifier and Type | Field and Description |
---|---|
private IDeclaredExceptionTable |
m_exceptions |
ATTRIBUTE_BRIDGE, ATTRIBUTE_CODE, ATTRIBUTE_CONSTANT_VALUE, ATTRIBUTE_EXCEPTIONS, ATTRIBUTE_INNERCLASSES, ATTRIBUTE_LINE_NUMBER_TABLE, ATTRIBUTE_SOURCEFILE, ATTRIBUTE_SYNTHETIC, m_attribute_length, m_name_index
Constructor and Description |
---|
ExceptionsAttribute_info(int attribute_name_index,
IDeclaredExceptionTable exceptions) |
ExceptionsAttribute_info(int attribute_name_index,
long attribute_length,
UDataInputStream bytes) |
Modifier and Type | Method and Description |
---|---|
void |
accept(IAttributeVisitor visitor,
java.lang.Object ctx) |
java.lang.Object |
clone()
Performs a deep copy.
|
IDeclaredExceptionTable |
getDeclaredExceptions() |
long |
length()
Returns the total length of this attribute when converted to
.class format [including the 6-byte header]
|
java.lang.String |
toString() |
void |
writeInClassFormat(UDataOutputStream out) |
getName, new_Attribute_info
private IDeclaredExceptionTable m_exceptions
public ExceptionsAttribute_info(int attribute_name_index, IDeclaredExceptionTable exceptions)
ExceptionsAttribute_info(int attribute_name_index, long attribute_length, UDataInputStream bytes) throws java.io.IOException
java.io.IOException
public IDeclaredExceptionTable getDeclaredExceptions()
public long length()
Attribute_info
length
in class Attribute_info
public void accept(IAttributeVisitor visitor, java.lang.Object ctx)
accept
in class Attribute_info
public java.lang.String toString()
toString
in class Attribute_info
public java.lang.Object clone()
clone
in class Attribute_info
public void writeInClassFormat(UDataOutputStream out) throws java.io.IOException
writeInClassFormat
in interface IClassFormatOutput
writeInClassFormat
in class Attribute_info
java.io.IOException