Class JsonbHttpMessageConverter
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
org.springframework.http.converter.AbstractGenericHttpMessageConverter<Object>
org.springframework.http.converter.json.AbstractJsonHttpMessageConverter
org.springframework.http.converter.json.JsonbHttpMessageConverter
- All Implemented Interfaces:
- GenericHttpMessageConverter<Object>,- HttpMessageConverter<Object>
Implementation of 
HttpMessageConverter
 that can read and write JSON using the
 JSON Binding API.
 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.
- Since:
- 5.0
- Author:
- Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class org.springframework.http.converter.json.AbstractJsonHttpMessageConverterDEFAULT_CHARSETFields inherited from class org.springframework.http.converter.AbstractHttpMessageConverterlogger
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct a newJsonbHttpMessageConverterwith default configuration.JsonbHttpMessageConverter(Jsonb jsonb) Construct a newJsonbHttpMessageConverterwith the given delegate.JsonbHttpMessageConverter(JsonbConfig config) Construct a newJsonbHttpMessageConverterwith the given configuration.
- 
Method SummaryModifier and TypeMethodDescriptiongetJsonb()Return the configuredJsonbinstance for this converter.protected ObjectreadInternal(Type resolvedType, Reader reader) Template method that reads the JSON-bound object from the givenReader.voidSet theJsonbinstance to use.protected booleanIndicates whether this message converter can write the given object multiple times.protected voidwriteInternal(Object object, Type type, Writer writer) Template method that writes the JSON-bound object to the givenWriter.Methods inherited from class org.springframework.http.converter.json.AbstractJsonHttpMessageConverterread, readInternal, setJsonPrefix, setPrefixJson, writeInternalMethods inherited from class org.springframework.http.converter.AbstractGenericHttpMessageConvertercanRead, canWrite, supports, write, writeInternalMethods inherited from class org.springframework.http.converter.AbstractHttpMessageConverteraddDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, writeMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.http.converter.HttpMessageConvertercanRead, canWrite, getSupportedMediaTypes, getSupportedMediaTypes, read, write
- 
Constructor Details- 
JsonbHttpMessageConverterpublic JsonbHttpMessageConverter()Construct a newJsonbHttpMessageConverterwith default configuration.
- 
JsonbHttpMessageConverterConstruct a newJsonbHttpMessageConverterwith the given configuration.- Parameters:
- config- the- JsonbConfigfor the underlying delegate
 
- 
JsonbHttpMessageConverterConstruct a newJsonbHttpMessageConverterwith the given delegate.- Parameters:
- jsonb- the Jsonb instance to use
 
 
- 
- 
Method Details- 
setJsonbSet theJsonbinstance to use. If not set, a defaultJsonbinstance will be created.Setting a custom-configured Jsonbis one way to take further control of the JSON serialization process.
- 
getJsonbReturn the configuredJsonbinstance for this converter.
- 
readInternalDescription copied from class:AbstractJsonHttpMessageConverterTemplate method that reads the JSON-bound object from the givenReader.- Specified by:
- readInternalin class- AbstractJsonHttpMessageConverter
- Parameters:
- resolvedType- the resolved generic type
- reader- the Reader to use
- Returns:
- the JSON-bound object
- Throws:
- Exception- in case of read/parse failures
 
- 
writeInternalDescription copied from class:AbstractJsonHttpMessageConverterTemplate method that writes the JSON-bound object to the givenWriter.- Specified by:
- writeInternalin class- AbstractJsonHttpMessageConverter
- Parameters:
- object- the object to write to the output message
- type- the type of object to write (may be- null)
- writer- the Writer to use
- Throws:
- Exception- in case of write failures
 
- 
supportsRepeatableWritesDescription copied from class:AbstractHttpMessageConverterIndicates whether this message converter can write the given object multiple times.The default implementation returns false.- Overrides:
- supportsRepeatableWritesin class- AbstractHttpMessageConverter<Object>
- Parameters:
- o- the object t
- Returns:
- trueif- tcan be written repeatedly;- falseotherwise
 
 
-