|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.bcel.generic.CodeExceptionGen
public final class CodeExceptionGen
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.
MethodGen
,
CodeException
,
InstructionHandle
,
Serialized FormConstructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
Object |
clone()
|
boolean |
containsTarget(InstructionHandle ih)
|
ObjectType |
getCatchType()
Gets the type of the Exception to catch, 'null' for ANY. |
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. |
InstructionHandle |
getEndPC()
|
InstructionHandle |
getHandlerPC()
|
InstructionHandle |
getStartPC()
|
void |
setCatchType(ObjectType catch_type)
Sets the type of the Exception to catch. |
void |
setEndPC(InstructionHandle end_pc)
|
void |
setHandlerPC(InstructionHandle handler_pc)
|
void |
setStartPC(InstructionHandle start_pc)
|
String |
toString()
|
void |
updateTarget(InstructionHandle old_ih,
InstructionHandle new_ih)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CodeExceptionGen(InstructionHandle start_pc, InstructionHandle end_pc, InstructionHandle handler_pc, ObjectType catch_type)
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 ANYMethod Detail |
---|
public CodeException getCodeException(ConstantPoolGen cp)
cp
- constant poolpublic void setStartPC(InstructionHandle start_pc)
public void setEndPC(InstructionHandle end_pc)
public void setHandlerPC(InstructionHandle handler_pc)
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
updateTarget
in interface InstructionTargeter
old_ih
- old target, either start or endnew_ih
- new targetpublic boolean containsTarget(InstructionHandle ih)
containsTarget
in interface InstructionTargeter
public void setCatchType(ObjectType catch_type)
public ObjectType getCatchType()
public InstructionHandle getStartPC()
public InstructionHandle getEndPC()
public InstructionHandle getHandlerPC()
public String toString()
toString
in class Object
public Object clone()
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |