public interface 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
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.
|
void addTry(InstructionBuilderCallback callback)
@Opcodes(value="TRYCATCHBLOCK") void addCatch(String exceptionClassName, InstructionBuilderCallback callback)
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.exceptionClassName
- caught exception classcallback
- that implements the logic of the catch block@Opcodes(value="TRYCATCHBLOCK") void addFinally(InstructionBuilderCallback callback)
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
addTry(InstructionBuilderCallback)
and any calls to
addCatch(String, InstructionBuilderCallback)
.callback
- implements the logic of the finally block5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.