FileDocCategorySizeDatePackage
ExceptionRange.javaAPI DocGlassfish v2 API4525Fri May 04 22:34:28 BST 2007com.sun.jdo.api.persistence.enhancer.classfile

ExceptionRange

public class ExceptionRange extends Object
ExceptionRange represents a range an exception handler within a method in class file.

Fields Summary
private InsnTarget
excStartPC
private InsnTarget
excEndPC
private InsnTarget
excHandlerPC
private ConstClass
excCatchType
Constructors Summary
public ExceptionRange(InsnTarget startPC, InsnTarget endPC, InsnTarget handlerPC, ConstClass catchType)
constructor

    excStartPC = startPC;
    excEndPC = endPC;
    excHandlerPC = handlerPC;
    excCatchType = catchType;
  
Methods Summary
public ConstClasscatchType()
return the exception specification a null return value means a catch of any (try/finally)

    return excCatchType;
  
public InsnTargetendPC()
return the end of the exception hander (exclusive)

    return excEndPC;
  
public InsnTargethandlerPC()
return the exception handler code

    return excHandlerPC;
  
voidprint(java.io.PrintStream out, int indent)

    ClassPrint.spaces(out, indent);
    out.print("Exc Range:");//NOI18N
    if (excCatchType == null)
        out.print("any");//NOI18N
    else
        out.print("'" + excCatchType.asString() + "'");//NOI18N
    out.print(" start = " + Integer.toString(excStartPC.offset()));//NOI18N
    out.print(" end = " + Integer.toString(excEndPC.offset()));//NOI18N
    out.println(" handle = " + Integer.toString(excHandlerPC.offset()));//NOI18N
  
static com.sun.jdo.api.persistence.enhancer.classfile.ExceptionRangeread(java.io.DataInputStream data, CodeEnv env)

    InsnTarget startPC = env.getTarget(data.readUnsignedShort());
    InsnTarget endPC = env.getTarget(data.readUnsignedShort());
    InsnTarget handlerPC = env.getTarget(data.readUnsignedShort());
    ConstClass catchType =
      (ConstClass) env.pool().constantAt(data.readUnsignedShort());
    return new ExceptionRange(startPC, endPC, handlerPC, catchType);
  
public InsnTargetstartPC()
return the start of the exception hander (inclusive)

    return excStartPC;
  
voidwrite(java.io.DataOutputStream out)

    out.writeShort(excStartPC.offset());
    out.writeShort(excEndPC.offset());
    out.writeShort(excHandlerPC.offset());
    out.writeShort(excCatchType == null ? 0 : excCatchType.getIndex());