org.apache.struts2.rest.handler

## Class JacksonJsonHandler

- java.lang.Object
- - org.apache.struts2.rest.handler.AbstractContentTypeHandler
  - - org.apache.struts2.rest.handler.JacksonJsonHandler

- All Implemented Interfaces:
    ContentTypeHandler

      public class JacksonJsonHandler
      extends AbstractContentTypeHandler

  Handles JSON content using jackson-lib

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JacksonJsonHandler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `fromObject(ActionInvocation invocation, Object obj, String resultCode, Writer stream)`
    `String` | `getContentType()` Gets the content type for this handler
    `String` | `getExtension()` Gets the extension this handler supports
    `void` | `setDefaultEncoding(String val)`
    `void` | `toObject(ActionInvocation invocation, Reader in, Object target)`

    - ### Methods inherited from class org.apache.struts2.rest.handler.AbstractContentTypeHandler

      `fromObject, toObject`

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

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

- - ### Constructor Detail

    - #### JacksonJsonHandler

          public JacksonJsonHandler()

  - ### Method Detail

    - #### toObject

          public void toObject(ActionInvocation invocation,
                               Reader in,
                               Object target)
                        throws IOException

      Throws:
        `IOException`

    - #### fromObject

          public String fromObject(ActionInvocation invocation,
                                   Object obj,
                                   String resultCode,
                                   Writer stream)
                            throws IOException

      Throws:
        `IOException`

    - #### getContentType

          public String getContentType()

      Description copied from interface: `ContentTypeHandler`
      Gets the content type for this handler
      Returns:
        The mime type

    - #### getExtension

          public String getExtension()

      Description copied from interface: `ContentTypeHandler`
      Gets the extension this handler supports
      Returns:
        The extension

    - #### setDefaultEncoding

          public void setDefaultEncoding(String val)

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.