public final class CodeExceptionGen extends Object implements InstructionTargeter, Cloneable
MethodGen
,
CodeException
,
InstructionHandle
Constructor and Description |
---|
CodeExceptionGen(InstructionHandle startPc,
InstructionHandle endPc,
InstructionHandle handlerPc,
ObjectType catchType)
Add an exception handler, i.e., specify region where a handler is active and an instruction where the actual handling
is done.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
boolean |
containsTarget(InstructionHandle ih)
Checks whether this targeter targets the specified instruction handle.
|
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 that the 'setPositions' methods has been called for the instruction list. |
InstructionHandle |
getEndPC() |
InstructionHandle |
getHandlerPC() |
InstructionHandle |
getStartPC() |
void |
setCatchType(ObjectType catchType)
Sets the type of the Exception to catch.
|
void |
setEndPC(InstructionHandle endPc) |
void |
setHandlerPC(InstructionHandle handlerPc) |
void |
setStartPC(InstructionHandle startPc) |
String |
toString() |
void |
updateTarget(InstructionHandle oldIh,
InstructionHandle newIh)
Replaces the target of this targeter from this old handle to the new handle.
|
public CodeExceptionGen(InstructionHandle startPc, InstructionHandle endPc, InstructionHandle handlerPc, ObjectType catchType)
startPc
- Start of handled region (inclusive)endPc
- End of handled region (inclusive)handlerPc
- Where handling is donecatchType
- which exception is handled, null for ANYpublic boolean containsTarget(InstructionHandle ih)
InstructionTargeter
containsTarget
in interface InstructionTargeter
public ObjectType getCatchType()
public CodeException getCodeException(ConstantPoolGen cp)
cp
- constant poolpublic InstructionHandle getEndPC()
public InstructionHandle getHandlerPC()
public InstructionHandle getStartPC()
public void setCatchType(ObjectType catchType)
public void setEndPC(InstructionHandle endPc)
public void setHandlerPC(InstructionHandle handlerPc)
public void setStartPC(InstructionHandle startPc)
public void updateTarget(InstructionHandle oldIh, InstructionHandle newIh)
InstructionTargeter
updateTarget
in interface InstructionTargeter
oldIh
- old target, either start or endnewIh
- new targetCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.