Package org.apache.tapestry5.internal.services

## Class JSONObjectEventResultProcessor

- java.lang.Object
- - org.apache.tapestry5.internal.services.JSONObjectEventResultProcessor

- All Implemented Interfaces:
    `ComponentEventResultProcessor<JSONObject>`

      public class JSONObjectEventResultProcessor
      extends java.lang.Object
      implements ComponentEventResultProcessor<JSONObject>

  Implementation of `ComponentEventResultProcessor` for `JSONObject`, allowing a component event handler to return a JSONObject that will be sent directly to the client as the reply. This is often used with custom components that need a custom JSON response.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `JSONObjectEventResultProcessor​(AjaxPartialResponseRenderer ajaxPartialResponseRenderer)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `processResultValue​(JSONObject value)` | For a given, non-null return value from a component event method, construct and send a response.

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

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

- - ### Constructor Detail

    - #### JSONObjectEventResultProcessor

          public JSONObjectEventResultProcessor​(AjaxPartialResponseRenderer ajaxPartialResponseRenderer)

  - ### Method Detail

    - #### processResultValue

          public void processResultValue​(JSONObject value)
                                  throws java.io.IOException

      Description copied from interface: `ComponentEventResultProcessor`
      For a given, non-null return value from a component event method, construct and send a response. Starting in release 5.4, it is recommended that for any response that involves Tapestry pages or components, the implementation should create an `IOOperation` to do the rendering, and add the operation to the `Request` as attribute `TapestryConstants.RESPONSE_RENDERER`. This avoids a number of issues related to the `Environment`.
      Specified by:
        `processResultValue` in interface `ComponentEventResultProcessor<JSONObject>`
      Parameters:
        `value` - the value returned from a method
      Throws:
        `java.io.IOException`