Class ExceptionTableEntry
java.lang.Object
org.fife.rsta.ac.java.classreader.ExceptionTableEntry
An entry in the exception table of a
Code attribute. 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
FieldsModifier and TypeFieldDescriptionprivate intIf the value ofcatchTypeis nonzero, it must be a valid index into the constant pool.private ClassFileThe parent class file.private intEnd of the range in the code array at which the exception handler is active.private intThe start of the exception handler.private intStart of the range in the code array at which the exception handler is active. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCaughtThrowableType(boolean fullyQualified) Returns the name of the Throwable type caught and handled by this exception handler.intgetEndPC()intintstatic ExceptionTableEntryread(ClassFile cf, DataInputStream in) Reads an exception table entry from an input stream.
-
Field Details
-
cf
The parent class file. -
startPC
private int startPCStart of the range in the code array at which the exception handler is active. -
endPC
private int endPCEnd 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 handlerPCThe 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 catchTypeIf 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 Details
-
ExceptionTableEntry
-
-
Method Details
-
getCaughtThrowableType
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
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:
IOException- If an IO error occurs.
-