Class ObjectToStringHttpMessageConverter

java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<Object>
org.springframework.http.converter.ObjectToStringHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<Object>

public class ObjectToStringHttpMessageConverter extends AbstractHttpMessageConverter<Object>
An HttpMessageConverter that uses StringHttpMessageConverter for reading and writing content and a ConversionService for converting the String content to and from the target object type.

By default, this converter supports the media type text/plain only. This can be overridden through the supportedMediaTypes property.

A usage example:

 <bean class="org.springframework.http.converter.ObjectToStringHttpMessageConverter">
   <constructor-arg>
     <bean class="org.springframework.context.support.ConversionServiceFactoryBean"/>
   </constructor-arg>
 </bean>
 
Since:
3.2
Author:
Dmitry Katsubo, Rossen Stoyanchev