public abstract class AbstractJaxb2HttpMessageConverter<T> extends AbstractXmlHttpMessageConverter<T>
HttpMessageConverters
that use JAXB2. Creates JAXBContext
object lazily.logger
Constructor and Description |
---|
AbstractJaxb2HttpMessageConverter() |
Modifier and Type | Method and Description |
---|---|
protected Marshaller |
createMarshaller(java.lang.Class<?> clazz)
Create a new
Marshaller for the given class. |
protected Unmarshaller |
createUnmarshaller(java.lang.Class<?> clazz)
Create a new
Unmarshaller for the given class. |
protected void |
customizeMarshaller(Marshaller marshaller)
Customize the
Marshaller created by this
message converter before using it to write the object to the output. |
protected void |
customizeUnmarshaller(Unmarshaller unmarshaller)
Customize the
Unmarshaller created by this
message converter before using it to read the object from the input. |
protected JAXBContext |
getJaxbContext(java.lang.Class<?> clazz)
Return a
JAXBContext for the given class. |
readFromSource, readInternal, transform, writeInternal, writeToResult
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, supports, write
protected final Marshaller createMarshaller(java.lang.Class<?> clazz)
Marshaller
for the given class.clazz
- the class to create the marshaller forMarshaller
HttpMessageConversionException
- in case of JAXB errorsprotected void customizeMarshaller(Marshaller marshaller)
Marshaller
created by this
message converter before using it to write the object to the output.marshaller
- the marshaller to customizecreateMarshaller(Class)
protected final Unmarshaller createUnmarshaller(java.lang.Class<?> clazz)
Unmarshaller
for the given class.clazz
- the class to create the unmarshaller forUnmarshaller
HttpMessageConversionException
- in case of JAXB errorsprotected void customizeUnmarshaller(Unmarshaller unmarshaller)
Unmarshaller
created by this
message converter before using it to read the object from the input.unmarshaller
- the unmarshaller to customizecreateUnmarshaller(Class)
protected final JAXBContext getJaxbContext(java.lang.Class<?> clazz)
JAXBContext
for the given class.clazz
- the class to return the context forJAXBContext
HttpMessageConversionException
- in case of JAXB errors