Class TryCatchBlockImpl
java.lang.Object
org.apache.tapestry5.internal.plastic.Lockable
org.apache.tapestry5.internal.plastic.TryCatchBlockImpl
- All Implemented Interfaces:
TryCatchBlock
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCatch(String exceptionClassName, InstructionBuilderCallback callback) Ends the block (if not already ended) and inserts a catch block for the named exception.voidaddFinally(InstructionBuilderCallback callback) As withTryCatchBlock.addCatch(String, InstructionBuilderCallback), but the exception caught is null, which acts as a finally block in the Java language.voidaddTry(InstructionBuilderCallback callback) Invoked first, to generate the code in which exceptions may be caught.
-
Method Details
-
addTry
Description copied from interface:TryCatchBlockInvoked first, to generate the code in which exceptions may be caught.- Specified by:
addTryin interfaceTryCatchBlock
-
addCatch
Description copied from interface:TryCatchBlockEnds the block (if not already ended) and inserts a catch block for the named exception. The InstructionBuilder is returned so that the code for handling the exception can be added. The exception object will be on top of the stack. This should be called afterTryCatchBlock.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.- Specified by:
addCatchin interfaceTryCatchBlock- Parameters:
exceptionClassName- caught exception classcallback- that implements the logic of the catch block
-
addFinally
Description copied from interface:TryCatchBlockAs withTryCatchBlock.addCatch(String, InstructionBuilderCallback), but the exception caught is null, which acts as a finally block in the Java language. This must be called last (afterTryCatchBlock.addTry(InstructionBuilderCallback)and any calls toTryCatchBlock.addCatch(String, InstructionBuilderCallback).- Specified by:
addFinallyin interfaceTryCatchBlock- Parameters:
callback- implements the logic of the finally block
-