org.springframework.http.converter.xml
Class AbstractJaxb2HttpMessageConverter<T>
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter<T>
- All Implemented Interfaces:
- HttpMessageConverter<T>
- Direct Known Subclasses:
- Jaxb2RootElementHttpMessageConverter
public abstract class AbstractJaxb2HttpMessageConverter<T>
- extends AbstractXmlHttpMessageConverter<T>
Abstract base class for HttpMessageConverters
that
use JAXB2. Creates JAXBContext
object lazily.
- Since:
- 3.0
- Author:
- Arjen Poutsma
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter |
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, supports, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractJaxb2HttpMessageConverter
public AbstractJaxb2HttpMessageConverter()
createMarshaller
protected final Marshaller createMarshaller(Class clazz)
- Creates a new
Marshaller
for the given class.
- Parameters:
clazz
- the class to create the marshaller for
- Returns:
- the
Marshaller
- Throws:
HttpMessageConversionException
- in case of JAXB errors
createUnmarshaller
protected final Unmarshaller createUnmarshaller(Class clazz)
throws JAXBException
- Creates a new
Unmarshaller
for the given class.
- Parameters:
clazz
- the class to create the unmarshaller for
- Returns:
- the
Unmarshaller
- Throws:
HttpMessageConversionException
- in case of JAXB errors
JAXBException
getJaxbContext
protected final JAXBContext getJaxbContext(Class clazz)
- Returns a
JAXBContext
for the given class.
- Parameters:
clazz
- the class to return the context for
- Returns:
- the
JAXBContext
- Throws:
HttpMessageConversionException
- in case of JAXB errors