Marshaller and Unmarshaller interface.
This implementation inspects the given Source or Result, and
delegates further handling to overridable template methods.
| Modifier and Type | Field and Description |
|---|---|
| private DocumentBuilderFactory | |
| private final Object | |
| protected final Log | logger
Logger available to subclasses. |
| private static final EntityResolver | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Document | buildDocument()
Build a new |
| protected DocumentBuilder | Returns: theDocumentBuilderthe factory)DocumentBuilderFactory that the DocumentBuilder should be created withCreate a |
| protected DocumentBuilderFactory | Returns: the DocumentBuilderFactoryCreate a |
| protected XMLReader | Returns: the XMLReaderCreate an |
| protected String | getDefaultEncoding()
Determine the default encoding to use for marshalling or unmarshalling from
a byte stream, or |
| public boolean | |
| public boolean | |
| public final void | marshal(Object
the root of the object graph to marshal graph, Result the result to marshal to result)Implements org. Marshals the object graph with the given root into the provided |
| protected abstract void | marshalDomNode(Object
the root of the object graph to marshal graph, Node the DOM node that will contain the result tree node)Abstract template method for marshalling the given object graph to a DOM |
| protected void | marshalDomResult(Object
the root of the object graph to marshal graph, DOMResult the domResult)DOMResultTemplate method for handling |
| protected abstract void | marshalOutputStream(Object
the root of the object graph to marshal graph, OutputStream the outputStream)OutputStream to write toAbstract template method for marshalling the given object graph to a |
| protected abstract void | marshalSaxHandlers(Object
the root of the object graph to marshal graph, ContentHandler the SAX contentHandler, LexicalHandler ContentHandlerthe SAX2 lexicalHandler)LexicalHandler. Can be null.Abstract template method for marshalling the given object graph to a SAX |
| protected void | marshalSaxResult(Object
the root of the object graph to marshal graph, SAXResult the saxResult)SAXResultTemplate method for handling |
| protected void | marshalStaxResult(Object
the root of the object graph to marshal graph, Result a JAXP 1.4 staxResult)StAXSourceTemplate method for handling |
| protected void | marshalStreamResult(Object
the root of the object graph to marshal graph, StreamResult the streamResult)StreamResultTemplate method for handling |
| protected abstract void | marshalWriter(Object
the root of the object graph to marshal graph, Writer the writer)Writer to write toAbstract template method for marshalling the given object graph to a |
| protected abstract void | marshalXmlEventWriter(Object
the root of the object graph to marshal graph, XMLEventWriter the eventWriter)XMLEventWriter to write toAbstract template method for marshalling the given object to a StAX |
| protected abstract void | marshalXmlStreamWriter(Object
the root of the object graph to marshal graph, XMLStreamWriter the streamWriter)XMLStreamWriter to write toAbstract template method for marshalling the given object to a StAX |
| public void | setProcessExternalEntities(boolean processExternalEntities)
Indicate whether external XML entities are processed when unmarshalling. |
| public void | |
| public final Object | Returns: the object graphthe source to marshal from source)Implements org. Unmarshals the given provided |
| protected abstract Object | Returns: the object graphthe DOM node that contains the objects to be unmarshalled node)Abstract template method for unmarshalling from a given DOM |
| protected Object | Returns: the object graphthe domSource)DOMSourceTemplate method for handling |
| protected abstract Object | Returns: the object graphthe inputStream)InputStreamStream to read fromAbstract template method for unmarshalling from a given |
| protected abstract Object | Returns: the object graphthe reader)Reader to read fromAbstract template method for unmarshalling from a given |
| protected abstract Object | Returns: the object graphthe SAX xmlReader, InputSource XMLReader to parse withthe input source to parse from inputSource)Abstract template method for unmarshalling using a given SAX |
| protected Object | Returns: the object graphthe saxSource)SAXSourceTemplate method for handling |
| protected Object | Returns: the object graphthe staxSource)StaxSourceTemplate method for handling |
| protected Object | Returns: the object graphthe streamSource)StreamSourceTemplate method for handling |
| protected abstract Object | Returns: the object graphthe eventReader)XMLEventReader to read fromAbstract template method for unmarshalling from a given Stax |
| protected abstract Object | Returns: the object graphthe streamReader)XMLStreamReader to read fromAbstract template method for unmarshalling from a given Stax |
| documentBuilderFactory | back to summary |
|---|---|
| private DocumentBuilderFactory documentBuilderFactory
| |
| documentBuilderFactoryMonitor | back to summary |
|---|---|
| private final Object documentBuilderFactoryMonitor | |
| logger | back to summary |
|---|---|
| protected final Log logger Logger available to subclasses. | |
| 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 | |
| AbstractMarshaller | back to summary |
|---|---|
| public AbstractMarshaller() | |
| buildDocument | back to summary |
|---|---|
| protected Document buildDocument() Build a new | |
| createDocumentBuilder | back to summary |
|---|---|
| protected DocumentBuilder createDocumentBuilder(DocumentBuilderFactory factory) throws ParserConfigurationException Create a Can be overridden in subclasses, adding further initialization of the builder.
| |
| createDocumentBuilderFactory | back to summary |
|---|---|
| protected DocumentBuilderFactory createDocumentBuilderFactory() throws ParserConfigurationException Create a The resulting
| |
| createXmlReader | back to summary |
|---|---|
| protected XMLReader createXmlReader() throws SAXException, ParserConfigurationException Create an
| |
| getDefaultEncoding | back to summary |
|---|---|
| protected String getDefaultEncoding() Determine the default encoding to use for marshalling or unmarshalling from
a byte stream, or The default implementation returns
| |
| 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. | |
| marshal | back to summary |
|---|---|
| public final void marshal(Object graph, Result result) throws IOException, XmlMappingException Implements org. Marshals the object graph with the given root into the provided This implementation inspects the given result, and calls
| |
| marshalDomNode | back to summary |
|---|---|
| protected abstract void marshalDomNode(Object graph, Node node) throws XmlMappingException Abstract template method for marshalling the given object graph to a DOM In practice,
| |
| marshalDomResult | back to summary |
|---|---|
| protected void marshalDomResult(Object graph, DOMResult domResult) throws XmlMappingException Template method for handling This implementation delegates to
| |
| marshalOutputStream | back to summary |
|---|---|
| protected abstract void marshalOutputStream(Object graph, OutputStream outputStream) throws XmlMappingException, IOException Abstract template method for marshalling the given object graph to a
| |
| marshalSaxHandlers | back to summary |
|---|---|
| protected abstract void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) throws XmlMappingException Abstract template method for marshalling the given object graph to a SAX
| |
| marshalSaxResult | back to summary |
|---|---|
| protected void marshalSaxResult(Object graph, SAXResult saxResult) throws XmlMappingException Template method for handling This implementation delegates to
| |
| marshalStaxResult | back to summary |
|---|---|
| protected void marshalStaxResult(Object graph, Result staxResult) throws XmlMappingException Template method for handling This implementation delegates to
| |
| marshalStreamResult | back to summary |
|---|---|
| protected void marshalStreamResult(Object graph, StreamResult streamResult) throws XmlMappingException, IOException Template method for handling This implementation delegates to
| |
| marshalWriter | back to summary |
|---|---|
| protected abstract void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException Abstract template method for marshalling the given object graph to a
| |
| marshalXmlEventWriter | back to summary |
|---|---|
| protected abstract void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) throws XmlMappingException Abstract template method for marshalling the given object to a StAX
| |
| marshalXmlStreamWriter | back to summary |
|---|---|
| protected abstract void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException Abstract template method for marshalling the given object to a StAX
| |
| setProcessExternalEntities | back to summary |
|---|---|
| public void setProcessExternalEntities(boolean processExternalEntities) Indicate whether external XML entities are processed when unmarshalling. 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 | |
| unmarshal | back to summary |
|---|---|
| public final Object unmarshal(Source source) throws IOException, XmlMappingException Implements org. Unmarshals the given provided This implementation inspects the given result, and calls
| |
| unmarshalDomNode | back to summary |
|---|---|
| protected abstract Object unmarshalDomNode(Node node) throws XmlMappingException Abstract template method for unmarshalling from a given DOM
| |
| unmarshalDomSource | back to summary |
|---|---|
| protected Object unmarshalDomSource(DOMSource domSource) throws XmlMappingException Template method for handling This implementation delegates to
| |
| unmarshalInputStream | back to summary |
|---|---|
| protected abstract Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException Abstract template method for unmarshalling from a given
| |
| unmarshalReader | back to summary |
|---|---|
| protected abstract Object unmarshalReader(Reader reader) throws XmlMappingException, IOException Abstract template method for unmarshalling from a given
| |
| unmarshalSaxReader | back to summary |
|---|---|
| protected abstract Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) throws XmlMappingException, IOException Abstract template method for unmarshalling using a given SAX
| |
| unmarshalSaxSource | back to summary |
|---|---|
| protected Object unmarshalSaxSource(SAXSource saxSource) throws XmlMappingException, IOException Template method for handling This implementation delegates to
| |
| unmarshalStaxSource | back to summary |
|---|---|
| protected Object unmarshalStaxSource(Source staxSource) throws XmlMappingException Template method for handling This implementation delegates to
| |
| unmarshalStreamSource | back to summary |
|---|---|
| protected Object unmarshalStreamSource(StreamSource streamSource) throws XmlMappingException, IOException Template method for handling This implementation delegates to
| |
| unmarshalXmlEventReader | back to summary |
|---|---|
| protected abstract Object unmarshalXmlEventReader(XMLEventReader eventReader) throws XmlMappingException Abstract template method for unmarshalling from a given Stax
| |
| unmarshalXmlStreamReader | back to summary |
|---|---|
| protected abstract Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException Abstract template method for unmarshalling from a given Stax
| |