All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.ClassFile.Raw.Attribute.AttributeExceptions

java.lang.Object
   |
   +----harpoon.ClassFile.Raw.Attribute.Attribute
           |
           +----harpoon.ClassFile.Raw.Attribute.AttributeExceptions

public class AttributeExceptions
extends Attribute
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. The must be exactly one Exceptions attribute in each method_info structure.

Version:
$Id: AttributeExceptions.java,v 1.10 1998/10/11 03:01:13 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Attribute, MethodInfo

Variable Index

 o exception_index_table
Each nonzero value in the exception_index_table must be a valid index into the constant_pool table.

Constructor Index

 o AttributeExceptions(ClassFile, int, int[])
Constructor.

Method Index

 o attribute_length()
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.
 o exception_index_table(int)
Returns the CONSTANT_Class_info corresponding to an entry in the exception_index_table.
 o number_of_exceptions()
 o print(PrintWriter, int)
Pretty-print the contents of this attribute.
 o write(ClassDataOutputStream)
Write to bytecode stream.

Variables

 o exception_index_table
 public int exception_index_table[]
Each nonzero value in the exception_index_table 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.

Constructors

 o AttributeExceptions
 public AttributeExceptions(ClassFile parent,
                            int attribute_name_index,
                            int exception_index_table[])
Constructor.

Methods

 o attribute_length
 public long attribute_length()
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.

Overrides:
attribute_length in class Attribute
 o number_of_exceptions
 public int number_of_exceptions()
 o exception_index_table
 public ConstantClass exception_index_table(int i)
Returns the CONSTANT_Class_info corresponding to an entry in the exception_index_table. Returns null if the entry is zero.

 o write
 public void write(ClassDataOutputStream out) throws IOException
Write to bytecode stream.

Overrides:
write in class Attribute
 o print
 public void print(PrintWriter pw,
                   int indent)
Pretty-print the contents of this attribute.

Parameters:
indent - the indentation level to use.
Overrides:
print in class Attribute

All Packages  Class Hierarchy  This Package  Previous  Next  Index