FileDocCategorySizeDatePackage
JExceptionsAttr.javaAPI DocphoneME MR2 API (J2ME)2670Wed May 02 18:00:40 BST 2007com.sun.satsa.jcrmic.classfile.attributes

JExceptionsAttr

public class JExceptionsAttr extends JAttribute
This class represents Exceptions attribute in the method_info structure. The Exception attribute indicates which checked exceptions a method may throw

Fields Summary
private int[]
index_table
Indexes of exception class names.
private String[]
exceptions
Exception class names.
Constructors Summary
public JExceptionsAttr(com.sun.satsa.jcrmic.classfile.constants.JConstantPool cp)
Constructor.

param
cp constant pool reference.

        super(cp);
    
Methods Summary
public java.lang.String[]getExceptions()
Returns exception class names.

return
exception class names

        return exceptions;
    
public voidparse(java.io.DataInputStream input)
Parses the attribute definition.

param
input input stream
throws
IOException if I/O exception occurs


        int length = input.readInt();
        index_table = new int[input.readUnsignedShort()];
        for (int i = 0; i < index_table.length; i++) {
            index_table[i] = input.readUnsignedShort();
        }
    
public voidresolve()
Resolves the attribute.

        exceptions = new String[index_table.length];
        for (int i = 0; i < index_table.length; i++) {
            exceptions[i] = cp.getConstantClass(index_table[i]).getClassName();
        }