Spring Framework

org.springframework.http.converter.xml
Class AbstractJaxb2HttpMessageConverter<T>

java.lang.Object
  extended by org.springframework.http.converter.AbstractHttpMessageConverter<T>
      extended by org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
          extended by 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

Field Summary
 
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
 
Constructor Summary
AbstractJaxb2HttpMessageConverter()
           
 
Method Summary
protected  javax.xml.bind.Marshaller createMarshaller(java.lang.Class clazz)
          Creates a new Marshaller for the given class.
protected  javax.xml.bind.Unmarshaller createUnmarshaller(java.lang.Class clazz)
          Creates a new Unmarshaller for the given class.
protected  javax.xml.bind.JAXBContext getJaxbContext(java.lang.Class clazz)
          Returns a JAXBContext for the given class.
 
Methods inherited from class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
readFromSource, readInternal, transform, writeInternal, writeToResult
 
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
 

Constructor Detail

AbstractJaxb2HttpMessageConverter

public AbstractJaxb2HttpMessageConverter()
Method Detail

createMarshaller

protected final javax.xml.bind.Marshaller createMarshaller(java.lang.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 javax.xml.bind.Unmarshaller createUnmarshaller(java.lang.Class clazz)
                                                        throws javax.xml.bind.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
javax.xml.bind.JAXBException

getJaxbContext

protected final javax.xml.bind.JAXBContext getJaxbContext(java.lang.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

Spring Framework