com.vladium.jcd.cls.attribute
Class ExceptionsAttribute_info
java.lang.Object
com.vladium.jcd.cls.attribute.Attribute_info
com.vladium.jcd.cls.attribute.ExceptionsAttribute_info
- All Implemented Interfaces:
- IClassFormatOutput, java.lang.Cloneable
public final class ExceptionsAttribute_info
- extends Attribute_info
The Exceptions attribute is a variable-length attribute used in the attributes
table of a 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
.
- Author:
- (C) 2001, Vlad Roubtsov
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
m_exceptions
private IDeclaredExceptionTable m_exceptions
ExceptionsAttribute_info
public ExceptionsAttribute_info(int attribute_name_index,
IDeclaredExceptionTable exceptions)
ExceptionsAttribute_info
ExceptionsAttribute_info(int attribute_name_index,
long attribute_length,
UDataInputStream bytes)
throws java.io.IOException
- Throws:
java.io.IOException
getDeclaredExceptions
public IDeclaredExceptionTable getDeclaredExceptions()
length
public long length()
- Description copied from class:
Attribute_info
- Returns the total length of this attribute when converted to
.class format [including the 6-byte header]
- Specified by:
length
in class Attribute_info
accept
public void accept(IAttributeVisitor visitor,
java.lang.Object ctx)
- Specified by:
accept
in class Attribute_info
toString
public java.lang.String toString()
- Specified by:
toString
in class Attribute_info
clone
public java.lang.Object clone()
- Performs a deep copy.
- Overrides:
clone
in class Attribute_info
writeInClassFormat
public void writeInClassFormat(UDataOutputStream out)
throws java.io.IOException
- Specified by:
writeInClassFormat
in interface IClassFormatOutput
- Overrides:
writeInClassFormat
in class Attribute_info
- Throws:
java.io.IOException