Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tapestry5.plastic
Interface TryCatchBlock

All Known Implementing Classes:
  TryCatchBlockImpl

    public interface TryCatchBlock

Allows a portion of a method to be marked so that exception and finally handlers can be provided.

See Also:
  `InstructionBuilder.startTryCatch(TryCatchCallback)`

Method Summary
`void` | `addCatch(java.lang.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.

Method Detail

### addTry

    void addTry(InstructionBuilderCallback callback)

  Invoked first, to generate the code in which exceptions may be caught.

### addCatch

    @Opcodes(value="TRYCATCHBLOCK")
    void addCatch(java.lang.String exceptionClassName,
                               InstructionBuilderCallback callback)

  Ends 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 after `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.

  Parameters:
    `exceptionClassName` - caught exception class
    `callback` - that implements the logic of the catch block

### addFinally

    @Opcodes(value="TRYCATCHBLOCK")
    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. This must be called last (after `addTry(InstructionBuilderCallback)` and any calls to `addCatch(String, InstructionBuilderCallback)`.

  Parameters:
    `callback` - implements the logic of the finally block

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 The Apache Software Foundation.