public abstract class AbstractJaxb2HttpMessageConverter<T> extends AbstractXmlHttpMessageConverter<T>
HttpMessageConverters
that use JAXB2. Creates JAXBContext object lazily.| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.ConcurrentMap<java.lang.Class<?>,javax.xml.bind.JAXBContext> |
jaxbContexts |
logger| Constructor and Description |
|---|
AbstractJaxb2HttpMessageConverter() |
| Modifier and Type | Method and Description |
|---|---|
protected javax.xml.bind.Marshaller |
createMarshaller(java.lang.Class<?> clazz)
Create a new
Marshaller for the given class. |
protected javax.xml.bind.Unmarshaller |
createUnmarshaller(java.lang.Class<?> clazz)
Create a new
Unmarshaller for the given class. |
protected void |
customizeMarshaller(javax.xml.bind.Marshaller marshaller)
Customize the
Marshaller created by this
message converter before using it to write the object to the output. |
protected void |
customizeUnmarshaller(javax.xml.bind.Unmarshaller unmarshaller)
Customize the
Unmarshaller created by this
message converter before using it to read the object from the input. |
protected javax.xml.bind.JAXBContext |
getJaxbContext(java.lang.Class<?> clazz)
Return a
JAXBContext for the given class. |
readFromSource, readInternal, transform, writeInternal, writeToResultaddDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, supports, writeprivate final java.util.concurrent.ConcurrentMap<java.lang.Class<?>,javax.xml.bind.JAXBContext> jaxbContexts
protected final javax.xml.bind.Marshaller createMarshaller(java.lang.Class<?> clazz)
Marshaller for the given class.clazz - the class to create the marshaller forMarshallerHttpMessageConversionException - in case of JAXB errorsprotected void customizeMarshaller(javax.xml.bind.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 javax.xml.bind.Unmarshaller createUnmarshaller(java.lang.Class<?> clazz)
throws javax.xml.bind.JAXBException
Unmarshaller for the given class.clazz - the class to create the unmarshaller forUnmarshallerHttpMessageConversionException - in case of JAXB errorsjavax.xml.bind.JAXBExceptionprotected void customizeUnmarshaller(javax.xml.bind.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 javax.xml.bind.JAXBContext getJaxbContext(java.lang.Class<?> clazz)
JAXBContext for the given class.clazz - the class to return the context forJAXBContextHttpMessageConversionException - in case of JAXB errors