|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectserp.bytecode.ExceptionHandler
public class ExceptionHandler
Represents a try {} catch() {} statement in bytecode.
| Method Summary | |
|---|---|
void |
acceptVisit(BCVisitor visit)
Accept a visit from a BCVisitor, calling the appropriate methods
to notify the visitor that it has entered this entity, and
to provide it with the proper callbacks for each sub-entity owned
by this one. |
BCClass |
getCatchBC()
Return the bytecode of the exception type; returns null for catch-all clauses used to implement finally blocks. |
int |
getCatchIndex()
Return the index into the class ConstantPool of the
ClassEntry describing the exception type this handler catches. |
String |
getCatchName()
Return the name of the exception type; returns null for catch-all clauses used to implement finally blocks. |
Class |
getCatchType()
Return the Class of the exception type; returns null for
catch-all clauses used to implement finally blocks. |
ClassLoader |
getClassLoader()
Return the class loader to use when loading related classes. |
Code |
getCode()
Return the owning code block. |
Instruction |
getHandlerStart()
Return the instruction marking the beginning of the catch {} block. |
int |
getHandlerStartPc()
|
ConstantPool |
getPool()
Return the constant pool of the current class. |
Project |
getProject()
Return the project of the current class. |
Instruction |
getTryEnd()
Return the instruction at the end of the try {} block. |
int |
getTryEndPc()
Return the program counter end position for this exception handler. |
Instruction |
getTryStart()
Return the instruction marking the beginning of the try {} block. |
int |
getTryStartPc()
|
boolean |
isValid()
Return false if this entity has been removed from its parent; in this case the results of any operations on the entity are undefined. |
void |
replaceTarget(Instruction oldTarget,
Instruction newTarget)
Replace the given old, likely invalid, target with a new target. |
void |
setCatch(BCClass type)
Set the class of the exception type, or null for catch-all clauses used for finally blocks. |
void |
setCatch(Class type)
Set the class of the exception type, or null for catch-all clauses used for finally blocks. |
void |
setCatch(String name)
Set the class of the exception type, or null for catch-all clauses used with finally blocks. |
void |
setCatchIndex(int catchTypeIndex)
Set the index into the class ConstantPool of the
ClassEntry describing the exception type this handler catches. |
void |
setHandlerStart(Instruction instruction)
Set the Instruction marking the beginning of the catch block. |
void |
setHandlerStart(int handler)
|
void |
setTryEnd(Instruction instruction)
Set the Instruction at the end of the try block. |
void |
setTryEnd(int end)
|
void |
setTryStart(Instruction instruction)
Set the Instruction marking the beginning of the try block. |
void |
setTryStart(int start)
|
void |
updateTargets()
Use the byte indexes read from the class file to calculate and set references to the target instruction(s) for this ptr. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Code getCode()
getCode in interface InstructionPtrpublic Instruction getTryStart()
public void setTryStart(Instruction instruction)
Instruction marking the beginning of the try block.
The instruction must already be a part of the method.
public Instruction getTryEnd()
public void setTryEnd(Instruction instruction)
public Instruction getHandlerStart()
public void setHandlerStart(Instruction instruction)
Instruction marking the beginning of the catch block.
The instruction must already be a part of the method.
WARNING: if this instruction is deleted, the results are undefined.
public int getCatchIndex()
ConstantPool of the
ClassEntry describing the exception type this handler catches.
public void setCatchIndex(int catchTypeIndex)
ConstantPool of the
ClassEntry describing the exception type this handler catches.
public String getCatchName()
Class.forName(java.lang.String) call.
public Class getCatchType()
Class of the exception type; returns null for
catch-all clauses used to implement finally blocks.
public BCClass getCatchBC()
public void setCatch(String name)
public void setCatch(Class type)
public void setCatch(BCClass type)
public void updateTargets()
InstructionPtr
updateTargets in interface InstructionPtr
public void replaceTarget(Instruction oldTarget,
Instruction newTarget)
InstructionPtr
replaceTarget in interface InstructionPtrpublic Project getProject()
BCEntity
getProject in interface BCEntitypublic ConstantPool getPool()
BCEntity
getPool in interface BCEntitypublic ClassLoader getClassLoader()
BCEntity
getClassLoader in interface BCEntitypublic boolean isValid()
BCEntity
isValid in interface BCEntitypublic void acceptVisit(BCVisitor visit)
VisitAcceptorBCVisitor, calling the appropriate methods
to notify the visitor that it has entered this entity, and
to provide it with the proper callbacks for each sub-entity owned
by this one.
acceptVisit in interface VisitAcceptorpublic void setTryStart(int start)
public int getTryStartPc()
public void setTryEnd(int end)
public int getTryEndPc()
public void setHandlerStart(int handler)
public int getHandlerStartPc()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||