java.lang.Object | ||
↳ | org.springframework.oxm.support.AbstractMarshaller | |
↳ | org.springframework.oxm.xmlbeans.XmlBeansMarshaller |
Implementation of the Marshaller
interface for Apache XMLBeans.
Options can be set by setting the xmlOptions
property.
The XmlOptionsFactoryBean
is provided to easily set up an XmlOptions instance.
Unmarshalled objects can be validated by setting the validating
property,
or by calling the validate(XmlObject)
method directly. Invalid objects will
result in an ValidationFailureException
.
NOTE: Due to the nature of XMLBeans, this marshaller requires all passed objects to be of type XmlObject.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.oxm.support.AbstractMarshaller
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the
XmlOptions . | |||||||||||
Return whether this marshaller should validate in- and outgoing documents.
| |||||||||||
Set whether this marshaller should validate in- and outgoing documents.
| |||||||||||
Set the
XmlOptions . | |||||||||||
This implementation returns true if the given class is an implementation of XmlObject.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convert the given XMLBeans exception to an appropriate exception from the
org.springframework.oxm hierarchy. | |||||||||||
Abstract template method for marshalling the given object graph to a DOM
Node . | |||||||||||
Abstract template method for marshalling the given object graph to a
OutputStream . | |||||||||||
Abstract template method for marshalling the given object graph to a SAX
ContentHandler . | |||||||||||
Abstract template method for marshalling the given object graph to a
Writer . | |||||||||||
Abstract template method for marshalling the given object to a StAX
XMLEventWriter . | |||||||||||
Abstract template method for marshalling the given object to a StAX
XMLStreamWriter . | |||||||||||
Abstract template method for unmarshalling from a given DOM
Node . | |||||||||||
Abstract template method for unmarshalling from a given
InputStream . | |||||||||||
Abstract template method for unmarshalling from a given
Reader . | |||||||||||
Abstract template method for unmarshalling using a given SAX
XMLReader
and InputSource . | |||||||||||
Abstract template method for unmarshalling from a given Stax
XMLEventReader . | |||||||||||
Abstract template method for unmarshalling from a given Stax
XMLStreamReader . | |||||||||||
Validate the given
XmlObject . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.oxm.support.AbstractMarshaller
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.oxm.Marshaller
| |||||||||||
From interface
org.springframework.oxm.Unmarshaller
|
Return the XmlOptions
.
Return whether this marshaller should validate in- and outgoing documents.
Set whether this marshaller should validate in- and outgoing documents.
Default is false
.
Set the XmlOptions
.
This implementation returns true if the given class is an implementation of XmlObject.
Convert the given XMLBeans exception to an appropriate exception from the
org.springframework.oxm
hierarchy.
A boolean flag is used to indicate whether this exception occurs during marshalling or unmarshalling, since XMLBeans itself does not make this distinction in its exception hierarchy.
ex | XMLBeans Exception that occured |
---|---|
marshalling | indicates whether the exception occurs during marshalling (true ),
or unmarshalling (false ) |
XmlMappingException
Abstract template method for marshalling the given object graph to a DOM Node
.
In practice, node is be a Document
node, a DocumentFragment
node,
or a Element
node. In other words, a node that accepts children.
graph | the root of the object graph to marshal |
---|---|
node | the DOM node that will contain the result tree |
XmlMappingException |
---|
Abstract template method for marshalling the given object graph to a OutputStream
.
graph | the root of the object graph to marshal |
---|---|
outputStream | the OutputStream to write to |
IOException | |
---|---|
XmlMappingException |
Abstract template method for marshalling the given object graph to a SAX ContentHandler
.
graph | the root of the object graph to marshal |
---|---|
contentHandler | the SAX ContentHandler |
lexicalHandler | the SAX2 LexicalHandler . Can be null . |
XmlMappingException |
---|
Abstract template method for marshalling the given object graph to a Writer
.
graph | the root of the object graph to marshal |
---|---|
writer | the Writer to write to |
IOException | |
---|---|
XmlMappingException |
Abstract template method for marshalling the given object to a StAX XMLEventWriter
.
graph | the root of the object graph to marshal |
---|---|
eventWriter | the XMLEventWriter to write to |
Abstract template method for marshalling the given object to a StAX XMLStreamWriter
.
graph | the root of the object graph to marshal |
---|---|
streamWriter | the XMLStreamWriter to write to |
XmlMappingException |
---|
Abstract template method for unmarshalling from a given DOM Node
.
node | the DOM node that contains the objects to be unmarshalled |
---|
XmlMappingException |
---|
Abstract template method for unmarshalling from a given InputStream
.
inputStream | the InputStreamStream to read from |
---|
IOException | |
---|---|
XmlMappingException |
Abstract template method for unmarshalling from a given Reader
.
reader | the Reader to read from |
---|
IOException | |
---|---|
XmlMappingException |
Abstract template method for unmarshalling using a given SAX XMLReader
and InputSource
.
xmlReader | the SAX XMLReader to parse with |
---|---|
inputSource | the input source to parse from |
IOException | |
---|---|
XmlMappingException |
Abstract template method for unmarshalling from a given Stax XMLEventReader
.
eventReader | the XMLEventReader to read from |
---|
XmlMappingException |
---|
Abstract template method for unmarshalling from a given Stax XMLStreamReader
.
streamReader | the XMLStreamReader to read from |
---|
XmlMappingException |
---|
Validate the given XmlObject
.
object | the xml object to validate |
---|
ValidationFailureException | if the given object is not valid |
---|