org.springframework.http.converter.xml
Class SimpleXmlHttpMessageConverter

java.lang.Object
  extended by org.springframework.http.converter.AbstractHttpMessageConverter<java.lang.Object>
      extended by org.springframework.http.converter.xml.SimpleXmlHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<java.lang.Object>

public class SimpleXmlHttpMessageConverter
extends AbstractHttpMessageConverter<java.lang.Object>

Implementation of HttpMessageConverter that can read and write XML using Simple's Persister abstraction. *

By default, this converter supports text/xml and application/xml. This can be overridden by setting the supportedMediaTypes property.

Since:
1.0.0

Field Summary
static java.nio.charset.Charset DEFAULT_CHARSET
           
 
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
 
Constructor Summary
SimpleXmlHttpMessageConverter()
          Protected constructor that sets the supportedMediaTypes to text/xml and application/xml, and application/*-xml.
 
Method Summary
 boolean canRead(java.lang.Class<?> clazz, MediaType mediaType)
           
 boolean canWrite(java.lang.Class<?> clazz, MediaType mediaType)
           
protected  java.lang.Object readInternal(java.lang.Class<? extends java.lang.Object> clazz, HttpInputMessage inputMessage)
           
protected  boolean supports(java.lang.Class<?> clazz)
           
protected  void writeInternal(java.lang.Object o, HttpOutputMessage outputMessage)
           
 
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CHARSET

public static final java.nio.charset.Charset DEFAULT_CHARSET
Constructor Detail

SimpleXmlHttpMessageConverter

public SimpleXmlHttpMessageConverter()
Protected constructor that sets the supportedMediaTypes to text/xml and application/xml, and application/*-xml.

Method Detail

canRead

public boolean canRead(java.lang.Class<?> clazz,
                       MediaType mediaType)
Specified by:
canRead in interface HttpMessageConverter<java.lang.Object>
Overrides:
canRead in class AbstractHttpMessageConverter<java.lang.Object>

canWrite

public boolean canWrite(java.lang.Class<?> clazz,
                        MediaType mediaType)
Specified by:
canWrite in interface HttpMessageConverter<java.lang.Object>
Overrides:
canWrite in class AbstractHttpMessageConverter<java.lang.Object>

supports

protected boolean supports(java.lang.Class<?> clazz)
Specified by:
supports in class AbstractHttpMessageConverter<java.lang.Object>

readInternal

protected java.lang.Object readInternal(java.lang.Class<? extends java.lang.Object> clazz,
                                        HttpInputMessage inputMessage)
                                 throws java.io.IOException
Specified by:
readInternal in class AbstractHttpMessageConverter<java.lang.Object>
Throws:
java.io.IOException

writeInternal

protected void writeInternal(java.lang.Object o,
                             HttpOutputMessage outputMessage)
                      throws java.io.IOException
Specified by:
writeInternal in class AbstractHttpMessageConverter<java.lang.Object>
Throws:
java.io.IOException