HttpMessageConverter that can read and write XML using JAXB2.
This converter can read classes annotated with XmlRootElement and
XmlType, and write classes annotated with XmlRootElement,
or subclasses thereof.
Note
When using Spring's Marshaller/Unmarshaller abstractions from spring-oxm,
you should use the MarshallingHttpMessageConverter instead.
MarshallingHttpMessageConverter
| Modifier and Type | Field and Description |
|---|---|
| private static final EntityResolver | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canRead(Class<?>
the class to test for readability clazz, MediaType the media type to read (can be mediaType)null if not specified);
typically the value of a Content-Type header.Overrides org. Implements org. This implementation checks if the given class is supported, and if the supported media types include the given media type. |
| public boolean | canWrite(Class<?>
the class to test for writability clazz, MediaType the media type to write (can be mediaType)null if not specified);
typically the value of an Accept header.Overrides org. Implements org. This implementation checks if the given class is supported, and if the supported media types include the given media type. |
| public boolean | |
| public boolean | |
| protected Source | |
| protected Object | readFromSource(Class<?>
the type of object to return clazz, HttpHeaders the HTTP input headers headers, Source the HTTP input body source)Implements abstract org. Abstract template method called from |
| private void | |
| public void | setProcessExternalEntities(boolean processExternalEntities)
Indicate whether external XML entities are processed when converting to a Source. |
| public void | |
| protected boolean | supports(Class<?>
the class to test for support clazz)Implements abstract org. Indicates whether the given class is supported by this converter. |
| protected boolean | supportsRepeatableWrites(Object
the object t o)Overrides org. Indicates whether this message converter can write the given object multiple times. |
| protected void | writeToResult(Object
the object to write to the output message o, HttpHeaders the HTTP output headers headers, Result the HTTP output body result)Implements abstract org. Abstract template method called from |
| NO_OP_ENTITY_RESOLVER | back to summary |
|---|---|
| private static final EntityResolver NO_OP_ENTITY_RESOLVER | |
| processExternalEntities | back to summary |
|---|---|
| private boolean processExternalEntities | |
| supportDtd | back to summary |
|---|---|
| private boolean supportDtd | |
| Jaxb2RootElementHttpMessageConverter | back to summary |
|---|---|
| public Jaxb2RootElementHttpMessageConverter() | |
| canRead | back to summary |
|---|---|
| public boolean canRead(Class<?> clazz, MediaType mediaType) Overrides org. Implements org. Doc from org. This implementation checks if the given class is supported, and if the supported media types include the given media type.
| |
| canWrite | back to summary |
|---|---|
| public boolean canWrite(Class<?> clazz, MediaType mediaType) Overrides org. Implements org. Doc from org. This implementation checks if the given class is supported, and if the supported media types include the given media type.
| |
| isProcessExternalEntities | back to summary |
|---|---|
| public boolean isProcessExternalEntities() Return whether XML external entities are allowed. | |
| isSupportDtd | back to summary |
|---|---|
| public boolean isSupportDtd() Return whether DTD parsing is supported. | |
| processSource | back to summary |
|---|---|
| protected Source processSource(Source source) | |
| readFromSource | back to summary |
|---|---|
| protected Object readFromSource(Class<?> clazz, HttpHeaders headers, Source source) throws Exception Implements abstract org. Doc from org. Abstract template method called from | |
| setCharset | back to summary |
|---|---|
| private void setCharset(MediaType contentType, Marshaller marshaller) throws PropertyException | |
| setProcessExternalEntities | back to summary |
|---|---|
| public void setProcessExternalEntities(boolean processExternalEntities) Indicate whether external XML entities are processed when converting to a Source. Default is Note setting this option to | |
| setSupportDtd | back to summary |
|---|---|
| public void setSupportDtd(boolean supportDtd) Indicate whether DTD parsing should be supported. Default is | |
| supports | back to summary |
|---|---|
| protected boolean supports(Class<?> clazz) Implements abstract org. Doc from org. Indicates whether the given class is supported by this converter. | |
| supportsRepeatableWrites | back to summary |
|---|---|
| protected boolean supportsRepeatableWrites(Object o) Overrides org. Doc from org. Indicates whether this message converter can write the given object multiple times. Default implementation returns | |
| writeToResult | back to summary |
|---|---|
| protected void writeToResult(Object o, HttpHeaders headers, Result result) throws Exception Implements abstract org. Doc from org. Abstract template method called from
| |