Package org.springframework.batch.item.json

# Class JacksonJsonObjectMarshaller<T>

java.lang.Object
org.springframework.batch.item.json.JacksonJsonObjectMarshaller<T>

Type Parameters:
  `T` - type of objects to marshal

All Implemented Interfaces:
  `JsonObjectMarshaller<T>`

public class JacksonJsonObjectMarshaller<T> extends Object implements JsonObjectMarshaller<T>
A json object marshaller that uses Jackson to marshal an object into a json representation.

Since:
  4.1
Author:
  Mahmoud Ben Hassine

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JacksonJsonObjectMarshaller()`
  `JacksonJsonObjectMarshaller(com.fasterxml.jackson.databind.ObjectMapper objectMapper)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `marshal(T item)`
  Marshal an object into a json representation.
  `void`
  `setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)`
  Set the `ObjectMapper` to use.

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

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

- ## Constructor Details

  - ### JacksonJsonObjectMarshaller

    public JacksonJsonObjectMarshaller()

  - ### JacksonJsonObjectMarshaller

    public JacksonJsonObjectMarshaller(com.fasterxml.jackson.databind.ObjectMapper objectMapper)

- ## Method Details

  - ### setObjectMapper

    public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    Set the `ObjectMapper` to use.
    Parameters:
      `objectMapper` - to use
    See Also:
      - `JacksonJsonObjectMarshaller(ObjectMapper)`

  - ### marshal

    public String marshal(T item)
    Description copied from interface: `JsonObjectMarshaller`
    Marshal an object into a json representation.
    Specified by:
      `marshal` in interface `JsonObjectMarshaller<T>`
    Parameters:
      `item` - to marshal
    Returns:
      json representation fo the object