Class GsonHttpMessageConverter

All Implemented Interfaces:
GenericHttpMessageConverter<Object>, HttpMessageConverter<Object>

public class GsonHttpMessageConverter extends AbstractJsonHttpMessageConverter
Implementation of HttpMessageConverter that can read and write JSON using the Google Gson library.

This converter can be used to bind to typed beans or untyped HashMaps. By default, it supports application/json and application/*+json with UTF-8 character set.

Tested against Gson 2.8; compatible with Gson 2.0 and higher.

Since:
4.1
Author:
Roy Clarkson, Juergen Hoeller
See Also:
  • Constructor Details

    • GsonHttpMessageConverter

      public GsonHttpMessageConverter()
      Construct a new GsonHttpMessageConverter with default configuration.
    • GsonHttpMessageConverter

      public GsonHttpMessageConverter(com.google.gson.Gson gson)
      Construct a new GsonHttpMessageConverter with the given delegate.
      Parameters:
      gson - the Gson instance to use
      Since:
      5.0
  • Method Details