Example usage for org.springframework.http.converter.xml MarshallingHttpMessageConverter MarshallingHttpMessageConverter

List of usage examples for org.springframework.http.converter.xml MarshallingHttpMessageConverter MarshallingHttpMessageConverter

Introduction

In this page you can find the example usage for org.springframework.http.converter.xml MarshallingHttpMessageConverter MarshallingHttpMessageConverter.

Prototype

public MarshallingHttpMessageConverter() 

Source Link

Document

Construct a new MarshallingHttpMessageConverter with no Marshaller or Unmarshaller set.

Usage

From source file:org.oncoblocks.centromere.web.config.WebServicesConfig.java

@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {

    FilteringJackson2HttpMessageConverter jsonConverter = new FilteringJackson2HttpMessageConverter();
    jsonConverter.setSupportedMediaTypes(ApiMediaTypes.getJsonMediaTypes());
    converters.add(jsonConverter);/*from  w ww  .  j  a  va  2s .com*/

    MarshallingHttpMessageConverter xmlConverter = new MarshallingHttpMessageConverter();
    xmlConverter.setSupportedMediaTypes(ApiMediaTypes.getXmlMediaTypes());
    XStreamMarshaller xStreamMarshaller = new XStreamMarshaller();
    xmlConverter.setMarshaller(xStreamMarshaller);
    xmlConverter.setUnmarshaller(xStreamMarshaller);
    converters.add(xmlConverter);

    FilteringTextMessageConverter filteringTextMessageConverter = new FilteringTextMessageConverter(
            new MediaType("text", "plain", Charset.forName("utf-8")));
    filteringTextMessageConverter.setDelimiter("\t");
    converters.add(filteringTextMessageConverter);

}