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(Class<?> clazz)
Create a new
Marshaller for the given class. |
protected Unmarshaller |
createUnmarshaller(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(Class<?> clazz)
Return a
JAXBContext for the given class. |
readFromSource, readInternal, transform, writeInternal, writeToResult
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, supports, write
protected final Marshaller createMarshaller(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(Class<?> clazz) throws JAXBException
Unmarshaller
for the given class.clazz
- the class to create the unmarshaller forUnmarshaller
HttpMessageConversionException
- in case of JAXB errorsJAXBException
protected 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(Class<?> clazz)
JAXBContext
for the given class.clazz
- the class to return the context forJAXBContext
HttpMessageConversionException
- in case of JAXB errors