Package org.zkoss.zk.ui.util

## Interface InitiatorExt

- All Known Implementing Classes:
    `Composition`, `GenericInitiator`

      public interface InitiatorExt

  An extra interface that can be implemented with `Initiator` to have the better control.
  Since:
    3.0.0
  Author:
    tomyeh
  See Also:
    `Initiator`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `doAfterCompose​(Page page, Component[] comps)` | Called after all components are created (a.k.a., composed), and before any event is processed.
    `boolean` | `doCatch​(java.lang.Throwable ex)` | Called when an exception occurs during the evaluation of the page.
    `void` | `doFinally()` | Do the cleanup after the page has been evaluated.

- - ### Method Detail

    - #### doAfterCompose

          void doAfterCompose​(Page page,
                              Component[] comps)
                       throws java.lang.Exception

      Called after all components are created (a.k.a., composed), and before any event is processed.

      It won't be called if an un-caught exception occurs when creating components.

      Parameters:
        `page` - the page that new components are attached to. It is the same as `Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>)`'s page argument.
        `comps` - the root components being created (never null, but the length might be zero). Note: It is not necessary the same as `Page.getRoots()`, since this method might be called thru `Executions.createComponents(java.lang.String, org.zkoss.zk.ui.Component, java.util.Map<?, ?>)`.
      Throws:
        `java.lang.Exception`
      Since:
        3.0.0

    - #### doCatch

          boolean doCatch​(java.lang.Throwable ex)
                   throws java.lang.Exception

      Called when an exception occurs during the evaluation of the page.

      If you don't want to handle the exception, simply returns false. `boolean doCatch(Throwable ex) {return false;}`

      An exception thrown in this method is simply logged. It has no effect on the execution. If you want to ignore the exception, just return true.

      Notice: this method won't be called if the exception occurs in `Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>)`.

      Parameters:
        `ex` - the exception being thrown
      Returns:
        whether to ignore the exception. If false is returned, the exception will be re-thrown. Note: once an initiator's doCatch returns true, the exception will be ignored and it means doCatch of the following initiators won't be called. Prior to ZK 3.0.0, void is returned and it means always re-thrown
      Throws:
        `java.lang.Exception`

    - #### doFinally

          void doFinally()
                  throws java.lang.Exception

      Do the cleanup after the page has been evaluated. It won't be called if `Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>)` throws an exception. However,it is always called no matter whether `doCatch(java.lang.Throwable)` is called.

      An exception thrown in this method is simply logged. It has no effect on the execution.

      Throws:
        `java.lang.Exception`