类 XmlBeansMarshaller
- java.lang.Object
- org.springframework.oxm.support.AbstractMarshaller
- org.springframework.oxm.xmlbeans.XmlBeansMarshaller
- 所有已实现的接口:
Marshaller
,Unmarshaller
@Deprecated public class XmlBeansMarshaller extends AbstractMarshaller
已过时。as of Spring 4.2, following the XMLBeans retirement at ApacheImplementation of theMarshaller
interface for Apache XMLBeans.Options can be set by setting the
xmlOptions
property. TheXmlOptionsFactoryBean
is provided to easily set up anXmlOptions
instance.Unmarshalled objects can be validated by setting the
validating
property, or by calling thevalidate(XmlObject)
method directly. Invalid objects will result in anValidationFailureException
.NOTE: Due to the nature of XMLBeans, this marshaller requires all passed objects to be of type
XmlObject
.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma
- 另请参阅:
setValidating(boolean)
,setXmlOptions(org.apache.xmlbeans.XmlOptions)
,XmlOptionsFactoryBean
字段概要
从类继承的字段 org.springframework.oxm.support.AbstractMarshaller
logger
构造器概要
构造器 构造器 说明 XmlBeansMarshaller()
已过时。
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 protected XmlMappingException
convertXmlBeansException(Exception ex, boolean marshalling)
已过时。Convert the given XMLBeans exception to an appropriate exception from theorg.springframework.oxm
hierarchy.org.apache.xmlbeans.XmlOptions
getXmlOptions()
已过时。Return theXmlOptions
.boolean
isValidating()
已过时。Return whether this marshaller should validate in- and outgoing documents.protected void
marshalDomNode(Object graph, Node node)
已过时。Abstract template method for marshalling the given object graph to a DOMNode
.protected void
marshalOutputStream(Object graph, OutputStream outputStream)
已过时。Abstract template method for marshalling the given object graph to aOutputStream
.protected void
marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
已过时。Abstract template method for marshalling the given object graph to a SAXContentHandler
.protected void
marshalWriter(Object graph, Writer writer)
已过时。Abstract template method for marshalling the given object graph to aWriter
.protected void
marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter)
已过时。Abstract template method for marshalling the given object to a StAXXMLEventWriter
.protected void
marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter)
已过时。Abstract template method for marshalling the given object to a StAXXMLStreamWriter
.void
setValidating(boolean validating)
已过时。Set whether this marshaller should validate in- and outgoing documents.void
setXmlOptions(org.apache.xmlbeans.XmlOptions xmlOptions)
已过时。Set theXmlOptions
.boolean
supports(Class<?> clazz)
已过时。This implementation returns true if the given class is an implementation ofXmlObject
.protected Object
unmarshalDomNode(Node node)
已过时。Abstract template method for unmarshalling from a given DOMNode
.protected Object
unmarshalInputStream(InputStream inputStream)
已过时。Abstract template method for unmarshalling from a givenInputStream
.protected Object
unmarshalReader(Reader reader)
已过时。Abstract template method for unmarshalling from a givenReader
.protected Object
unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
已过时。Abstract template method for unmarshalling using a given SAXXMLReader
andInputSource
.protected Object
unmarshalXmlEventReader(XMLEventReader eventReader)
已过时。Abstract template method for unmarshalling from a given StaxXMLEventReader
.protected Object
unmarshalXmlStreamReader(XMLStreamReader streamReader)
已过时。Abstract template method for unmarshalling from a given StaxXMLStreamReader
.protected void
validate(org.apache.xmlbeans.XmlObject object)
已过时。Validate the givenXmlObject
.从类继承的方法 org.springframework.oxm.support.AbstractMarshaller
buildDocument, createDocumentBuilder, createDocumentBuilderFactory, createXmlReader, getDefaultEncoding, isProcessExternalEntities, isSupportDtd, marshal, marshalDomResult, marshalSaxResult, marshalStaxResult, marshalStreamResult, setProcessExternalEntities, setSupportDtd, unmarshal, unmarshalDomSource, unmarshalSaxSource, unmarshalStaxSource, unmarshalStreamSource
构造器详细资料
XmlBeansMarshaller
public XmlBeansMarshaller()
已过时。
方法详细资料
setXmlOptions
public void setXmlOptions(org.apache.xmlbeans.XmlOptions xmlOptions)
已过时。Set theXmlOptions
.
getXmlOptions
public org.apache.xmlbeans.XmlOptions getXmlOptions()
已过时。Return theXmlOptions
.
setValidating
public void setValidating(boolean validating)
已过时。Set whether this marshaller should validate in- and outgoing documents. Default isfalse
.
isValidating
public boolean isValidating()
已过时。Return whether this marshaller should validate in- and outgoing documents.
supports
public boolean supports(Class<?> clazz)
已过时。This implementation returns true if the given class is an implementation ofXmlObject
.- 参数:
clazz
- the class that this marshaller is being asked if it can marshal- 返回:
true
if this marshaller can indeed marshal instances of the supplied class;false
otherwise
marshalDomNode
protected void marshalDomNode(Object graph, Node node) throws XmlMappingException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for marshalling the given object graph to a DOMNode
.In practice, node is be a
Document
node, aDocumentFragment
node, or aElement
node. In other words, a node that accepts children.- 指定者:
marshalDomNode
在类中AbstractMarshaller
- 参数:
graph
- the root of the object graph to marshalnode
- the DOM node that will contain the result tree- 抛出:
XmlMappingException
- if the given object cannot be marshalled to the DOM node- 另请参阅:
Document
,DocumentFragment
,Element
marshalXmlEventWriter
protected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter)
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for marshalling the given object to a StAXXMLEventWriter
.- 指定者:
marshalXmlEventWriter
在类中AbstractMarshaller
- 参数:
graph
- the root of the object graph to marshaleventWriter
- theXMLEventWriter
to write to
marshalXmlStreamWriter
protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for marshalling the given object to a StAXXMLStreamWriter
.- 指定者:
marshalXmlStreamWriter
在类中AbstractMarshaller
- 参数:
graph
- the root of the object graph to marshalstreamWriter
- theXMLStreamWriter
to write to- 抛出:
XmlMappingException
- if the given object cannot be marshalled to the DOM node
marshalSaxHandlers
protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) throws XmlMappingException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for marshalling the given object graph to a SAXContentHandler
.- 指定者:
marshalSaxHandlers
在类中AbstractMarshaller
- 参数:
graph
- the root of the object graph to marshalcontentHandler
- the SAXContentHandler
lexicalHandler
- the SAX2LexicalHandler
. Can benull
.- 抛出:
XmlMappingException
- if the given object cannot be marshalled to the handlers
marshalOutputStream
protected void marshalOutputStream(Object graph, OutputStream outputStream) throws XmlMappingException, IOException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for marshalling the given object graph to aOutputStream
.- 指定者:
marshalOutputStream
在类中AbstractMarshaller
- 参数:
graph
- the root of the object graph to marshaloutputStream
- theOutputStream
to write to- 抛出:
XmlMappingException
- if the given object cannot be marshalled to the writerIOException
- if an I/O exception occurs
marshalWriter
protected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for marshalling the given object graph to aWriter
.- 指定者:
marshalWriter
在类中AbstractMarshaller
- 参数:
graph
- the root of the object graph to marshalwriter
- theWriter
to write to- 抛出:
XmlMappingException
- if the given object cannot be marshalled to the writerIOException
- if an I/O exception occurs
unmarshalDomNode
protected Object unmarshalDomNode(Node node) throws XmlMappingException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for unmarshalling from a given DOMNode
.- 指定者:
unmarshalDomNode
在类中AbstractMarshaller
- 参数:
node
- the DOM node that contains the objects to be unmarshalled- 返回:
- the object graph
- 抛出:
XmlMappingException
- if the given DOM node cannot be mapped to an object
unmarshalXmlEventReader
protected Object unmarshalXmlEventReader(XMLEventReader eventReader) throws XmlMappingException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for unmarshalling from a given StaxXMLEventReader
.- 指定者:
unmarshalXmlEventReader
在类中AbstractMarshaller
- 参数:
eventReader
- theXMLEventReader
to read from- 返回:
- the object graph
- 抛出:
XmlMappingException
- if the given event reader cannot be converted to an object
unmarshalXmlStreamReader
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for unmarshalling from a given StaxXMLStreamReader
.- 指定者:
unmarshalXmlStreamReader
在类中AbstractMarshaller
- 参数:
streamReader
- theXMLStreamReader
to read from- 返回:
- the object graph
- 抛出:
XmlMappingException
- if the given stream reader cannot be converted to an object
unmarshalSaxReader
protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) throws XmlMappingException, IOException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for unmarshalling using a given SAXXMLReader
andInputSource
.- 指定者:
unmarshalSaxReader
在类中AbstractMarshaller
- 参数:
xmlReader
- the SAXXMLReader
to parse withinputSource
- the input source to parse from- 返回:
- the object graph
- 抛出:
XmlMappingException
- if the given reader and input source cannot be converted to an objectIOException
- if an I/O exception occurs
unmarshalInputStream
protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for unmarshalling from a givenInputStream
.- 指定者:
unmarshalInputStream
在类中AbstractMarshaller
- 参数:
inputStream
- theInputStreamStream
to read from- 返回:
- the object graph
- 抛出:
XmlMappingException
- if the given stream cannot be converted to an objectIOException
- if an I/O exception occurs
unmarshalReader
protected Object unmarshalReader(Reader reader) throws XmlMappingException, IOException
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for unmarshalling from a givenReader
.- 指定者:
unmarshalReader
在类中AbstractMarshaller
- 参数:
reader
- theReader
to read from- 返回:
- the object graph
- 抛出:
XmlMappingException
- if the given reader cannot be converted to an objectIOException
- if an I/O exception occurs
validate
protected void validate(org.apache.xmlbeans.XmlObject object) throws ValidationFailureException
已过时。Validate the givenXmlObject
.- 参数:
object
- the xml object to validate- 抛出:
ValidationFailureException
- if the given object is not valid
convertXmlBeansException
protected XmlMappingException convertXmlBeansException(Exception ex, boolean marshalling)
已过时。Convert the given XMLBeans exception to an appropriate exception from theorg.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 occuredmarshalling
- indicates whether the exception occurs during marshalling (true
), or unmarshalling (false
)- 返回:
- the corresponding
XmlMappingException