Class ExceptionTableEntry
- java.lang.Object
-
- org.fife.rsta.ac.java.classreader.ExceptionTableEntry
-
public class ExceptionTableEntry extends java.lang.ObjectAn entry in the exception table of aCodeattribute. This denotes either a catch or finally block (the section of code it covers, the type of Throwable it handles, and the location of the exception handler code).- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private intcatchTypeIf the value ofcatchTypeis nonzero, it must be a valid index into the constant pool.private ClassFilecfThe parent class file.private intendPCEnd of the range in the code array at which the exception handler is active.private inthandlerPCThe start of the exception handler.private intstartPCStart of the range in the code array at which the exception handler is active.
-
Constructor Summary
Constructors Constructor Description ExceptionTableEntry(ClassFile cf)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCaughtThrowableType(boolean fullyQualified)Returns the name of the Throwable type caught and handled by this exception handler.intgetEndPC()intgetHandlerPC()intgetStartPC()static ExceptionTableEntryread(ClassFile cf, java.io.DataInputStream in)Reads an exception table entry from an input stream.
-
-
-
Field Detail
-
cf
private ClassFile cf
The parent class file.
-
startPC
private int startPC
Start of the range in the code array at which the exception handler is active.
-
endPC
private int endPC
End of the range in the code array at which the exception handler is active. This value must be either a valid index into the code array of the opcode of an instruction, or be equal toCode.getCodeLength().
-
handlerPC
private int handlerPC
The start of the exception handler. This value must be a valid index into the code array and must be the index of the opcode of an instruction.
-
catchType
private int catchType
If the value ofcatchTypeis nonzero, it must be a valid index into the constant pool. The constant pool entry at that index must be aConstantClassInfostructure representing a class of exceptions that this exception handler is designated to catch. This class must be the classThrowableor one of its subclasses. The exception handler will be called only if the thrown exception is an instance of the given class or one of its subclasses.If the value of
catchTypeis zero, this exception handler is for all exceptions. This is used to implementfinally.
-
-
Constructor Detail
-
ExceptionTableEntry
public ExceptionTableEntry(ClassFile cf)
Constructor.- Parameters:
cf- The parent class file.
-
-
Method Detail
-
getCaughtThrowableType
public java.lang.String getCaughtThrowableType(boolean fullyQualified)
Returns the name of the Throwable type caught and handled by this exception handler.- Parameters:
fullyQualified- Whether the name should be fully qualified.- Returns:
- The name of the Throwable type, or
nullif this entry denotes a finally block.
-
getEndPC
public int getEndPC()
-
getHandlerPC
public int getHandlerPC()
-
getStartPC
public int getStartPC()
-
read
public static ExceptionTableEntry read(ClassFile cf, java.io.DataInputStream in) throws java.io.IOException
Reads an exception table entry from an input stream.- Parameters:
cf- The class file.in- The input stream to read from.- Returns:
- The exception table entry.
- Throws:
java.io.IOException- If an IO error occurs.
-
-