Skip to content

Commit

Permalink
Polish ObjectToStringHttpMessageConverter
Browse files Browse the repository at this point in the history
Issue: SPR-9738
  • Loading branch information
rstoyanchev committed Sep 25, 2012
1 parent 8a082e6 commit 2bb0104
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,30 @@
*/
public class ObjectToStringHttpMessageConverter extends AbstractHttpMessageConverter<Object> {

public static final Charset DEFAULT_CHARSET = Charset.forName("ISO-8859-1");

private ConversionService conversionService;

private StringHttpMessageConverter stringHttpMessageConverter;


/**
* A constructor accepting a {@code ConversionService} to use to convert the
* (String) message body to/from the target class type.
* (String) message body to/from the target class type. This constructor
* uses {@link StringHttpMessageConverter#DEFAULT_CHARSET} as the default
* charset.
*
* @param conversionService the conversion service
*/
public ObjectToStringHttpMessageConverter(ConversionService conversionService) {
this(conversionService, DEFAULT_CHARSET);
this(conversionService, StringHttpMessageConverter.DEFAULT_CHARSET);
}

/**
* A constructor accepting a {@code ConversionService} as well as a default
* charset.
*
* @param conversionService the conversion service
* @param defaultCharset the default charset
*/
public ObjectToStringHttpMessageConverter(ConversionService conversionService, Charset defaultCharset) {
super(new MediaType("text", "plain", defaultCharset));

Expand Down

0 comments on commit 2bb0104

Please sign in to comment.