public abstract class

AbstractXmlHttpMessageConverter

extends AbstractHttpMessageConverter<T>
java.lang.Object
   ↳ org.springframework.http.converter.AbstractHttpMessageConverter<T>
     ↳ org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Abstract base class for HttpMessageConverters that convert from/to XML.

By default, subclasses of this converter support text/xml, application/xml, and application/*-xml. This can be overridden by setting the supportedMediaTypes property.

Summary

[Expand]
Inherited Fields
From class org.springframework.http.converter.AbstractHttpMessageConverter
Protected Constructors
AbstractXmlHttpMessageConverter()
Protected constructor that sets the supportedMediaTypes to text/xml and application/xml, and application/*-xml.
Public Methods
final T readInternal(Class<? extends T> clazz, HttpInputMessage inputMessage)
Abstract template method that reads the actualy object.
Protected Methods
abstract T readFromSource(Class<? extends T> clazz, HttpHeaders headers, Source source)
Abstract template method called from read(Class, HttpInputMessage).
void transform(Source source, Result result)
Transforms the given Source to the Result.
final void writeInternal(T t, HttpOutputMessage outputMessage)
Abstract template method that writes the actual body.
abstract void writeToResult(T t, HttpHeaders headers, Result result)
Abstract template method called from writeInternal(Object, HttpOutputMessage).
[Expand]
Inherited Methods
From class org.springframework.http.converter.AbstractHttpMessageConverter
From class java.lang.Object
From interface org.springframework.http.converter.HttpMessageConverter

Protected Constructors

protected AbstractXmlHttpMessageConverter ()

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

Public Methods

public final T readInternal (Class<? extends T> clazz, HttpInputMessage inputMessage)

Abstract template method that reads the actualy object. Invoked from read(Class, HttpInputMessage).

Parameters
clazz the type of object to return
inputMessage the HTTP input message to read from
Returns
  • the converted object
Throws
IOException

Protected Methods

protected abstract T readFromSource (Class<? extends T> clazz, HttpHeaders headers, Source source)

Abstract template method called from read(Class, HttpInputMessage).

Parameters
clazz the type of object to return
headers the HTTP input headers
source the HTTP input body
Returns
  • the converted object
Throws
IOException in case of I/O errors
HttpMessageConversionException in case of conversion errors

protected void transform (Source source, Result result)

Transforms the given Source to the Result.

Parameters
source the source to transform from
result the result to transform to
Throws
TransformerException in case of transformation errors

protected final void writeInternal (T t, HttpOutputMessage outputMessage)

Abstract template method that writes the actual body. Invoked from write(T, MediaType, HttpOutputMessage).

Parameters
t the object to write to the output message
outputMessage the message to write to
Throws
IOException

protected abstract void writeToResult (T t, HttpHeaders headers, Result result)

Abstract template method called from writeInternal(Object, HttpOutputMessage).

Parameters
t the object to write to the output message
headers the HTTP output headers
result the HTTP output body
Throws
IOException in case of I/O errors
HttpMessageConversionException in case of conversion errors