org.apache.bcel.generic
Class CodeExceptionGen
java.lang.Object
org.apache.bcel.generic.CodeExceptionGen
- Cloneable, InstructionTargeter, java.io.Serializable
public final class CodeExceptionGen
extends java.lang.Object
This class represents an exception handler, i.e., specifies the region where
a handler is active and an instruction where the actual handling is done.
pool as parameters. Opposed to the JVM specification the end of the handled
region is set to be inclusive, i.e. all instructions between start and end
are protected including the start and end instructions (handles) themselves.
The end of the region is automatically mapped to be exclusive when calling
getCodeException(), i.e., there is no difference semantically.
$Id: CodeExceptionGen.java,v 1.2 2002/07/11 19:39:04 mdahm Exp $
CodeExceptionGen
public CodeExceptionGen(InstructionHandle start_pc,
InstructionHandle end_pc,
InstructionHandle handler_pc,
ObjectType catch_type)
Add an exception handler, i.e., specify region where a handler is active and an
instruction where the actual handling is done.
start_pc
- Start of handled region (inclusive)end_pc
- End of handled region (inclusive)handler_pc
- Where handling is donecatch_type
- which exception is handled, null for ANY
clone
public Object clone()
getCatchType
public ObjectType getCatchType()
Gets the type of the Exception to catch, 'null' for ANY.
getCodeException
public CodeException getCodeException(ConstantPoolGen cp)
Get CodeException object.
This relies on that the instruction list has already been dumped
to byte code or or that the `setPositions' methods has been
called for the instruction list.
setCatchType
public void setCatchType(ObjectType catch_type)
Sets the type of the Exception to catch. Set 'null' for ANY.
toString
public String toString()