public class TryCatchBlockImpl extends Lockable implements TryCatchBlock
| Modifier and Type | Method and Description |
|---|---|
void |
addCatch(String exceptionClassName,
InstructionBuilderCallback callback)
Ends the block (if not already ended) and inserts a catch block for the named exception.
|
void |
addFinally(InstructionBuilderCallback callback)
As with
TryCatchBlock.addCatch(String, InstructionBuilderCallback), but the exception caught is
null, which acts as a finally block in the Java language. |
void |
addTry(InstructionBuilderCallback callback)
Invoked first, to generate the code in which exceptions may be caught.
|
public void addTry(InstructionBuilderCallback callback)
TryCatchBlockaddTry in interface TryCatchBlockpublic void addCatch(String exceptionClassName, InstructionBuilderCallback callback)
TryCatchBlockTryCatchBlock.addTry(InstructionBuilderCallback).
Note: no attempt is made currently to sort the handlers; for example adding a catch for java.lang.Exception first
will mean that more specific exception handlers added later will never be invoked.addCatch in interface TryCatchBlockexceptionClassName - caught exception classcallback - that implements the logic of the catch blockpublic void addFinally(InstructionBuilderCallback callback)
TryCatchBlockTryCatchBlock.addCatch(String, InstructionBuilderCallback), but the exception caught is
null, which acts as a finally block in the Java language. This must be called last (after
TryCatchBlock.addTry(InstructionBuilderCallback) and any calls to
TryCatchBlock.addCatch(String, InstructionBuilderCallback).addFinally in interface TryCatchBlockcallback - implements the logic of the finally block5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.