java.lang.Object | |||
↳ | org.springframework.http.converter.AbstractHttpMessageConverter<T> | ||
↳ | org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T> | ||
↳ | org.springframework.http.converter.xml.MarshallingHttpMessageConverter |
Implementation of HttpMessageConverter
that can read and write XML using Spring's Marshaller
and Unmarshaller
abstractions.
This converter requires a Marshaller
and Unmarshaller
before it can be used.
These can be injected by the constructor
or bean properties
.
By default, this converter supports text/xml
and application/xml
. This can be
overridden by setting the supportedMediaTypes
property.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.http.converter.AbstractHttpMessageConverter
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a new
MarshallingMessageConverter with the given Marshaller set. | |||||||||||
Construct a new
MarshallingMessageConverter with the given
Marshaller and Unmarshaller . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Set the
Marshaller to be used by this message converter. | |||||||||||
Set the
Unmarshaller to be used by this message converter. | |||||||||||
Indicates whether the given class is supported by this converter.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Abstract template method called from
read(Class, HttpInputMessage) . | |||||||||||
Abstract template method called from
writeInternal(Object, HttpOutputMessage) . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
| |||||||||||
From class
org.springframework.http.converter.AbstractHttpMessageConverter
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.http.converter.HttpMessageConverter
|
Construct a new MarshallingHttpMessageConverter
with no Marshaller
or
Unmarshaller
set. The Marshaller and Unmarshaller must be set after construction
by invoking setMarshaller(Marshaller)
and setUnmarshaller(Unmarshaller)
.
Construct a new MarshallingMessageConverter
with the given Marshaller
set.
If the given Marshaller
also implements the Unmarshaller
interface,
it is used for both marshalling and unmarshalling. Otherwise, an exception is thrown.
Note that all Marshaller
implementations in Spring also implement the
Unmarshaller
interface, so that you can safely use this constructor.
marshaller | object used as marshaller and unmarshaller |
---|
Construct a new MarshallingMessageConverter
with the given
Marshaller
and Unmarshaller
.
marshaller | the Marshaller to use |
---|---|
unmarshaller | the Unmarshaller to use |
Set the Marshaller
to be used by this message converter.
Set the Unmarshaller
to be used by this message converter.
Indicates whether the given class is supported by this converter.
clazz | the class to test for support |
---|
true
if supported; false
otherwise
Abstract template method called from read(Class, HttpInputMessage)
.
clazz | the type of object to return |
---|---|
headers | the HTTP input headers |
source | the HTTP input body |
IOException |
---|
Abstract template method called from writeInternal(Object, HttpOutputMessage)
.
o | the object to write to the output message |
---|---|
headers | the HTTP output headers |
result | the HTTP output body |
IOException |
---|