org.apache.tapestry5.internal.util

## Class CaptureResultCallback<T>

- java.lang.Object
- - org.apache.tapestry5.internal.util.CaptureResultCallback<T>

- All Implemented Interfaces:
    ComponentEventCallback<T>

      public class CaptureResultCallback<T>
      extends Object
      implements ComponentEventCallback<T>

  Implementation of `ComponentEventCallback` that simply captures the result value.
  Since:
    5.2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CaptureResultCallback()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> CaptureResultCallback<T>` | `create()`
    `T` | `getResult()`
    `boolean` | `handleResult(T result)` Invoked to handle a non-null event handler method result.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CaptureResultCallback

          public CaptureResultCallback()

  - ### Method Detail

    - #### handleResult

          public boolean handleResult(T result)

      Description copied from interface: `ComponentEventCallback`
      Invoked to handle a non-null event handler method result. The handler should determine whether the value is acceptable, and throw an exception if not. Any thrown exception will be wrapped to identify the component and method from which the value was returned.

      Boolean values are not passed to the callback. Booleans are used to indicate that the event has been handled (true, meaning the event is handled and aborted) or that a further search for handlers should continue (false, meaning the event was not handled, is not aborted, and the search up the component hierarchy for event handler methods should continue). If a component event method returns true, then `Event.isAborted()` will return true.
      Specified by:
        `handleResult` in interface `ComponentEventCallback<T>`
      Parameters:
        `result` - the result value returned from the event handler method
      Returns:
        true if the event is aborted, false if the event may continue

    - #### getResult

          public T getResult()

    - #### create

          public static <T> CaptureResultCallback<T> create()

${project.version} - Copyright © 2003-2014 The Apache Software Foundation.