类 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 theMarshallerinterface for Apache XMLBeans.Options can be set by setting the
xmlOptionsproperty. TheXmlOptionsFactoryBeanis provided to easily set up anXmlOptionsinstance.Unmarshalled objects can be validated by setting the
validatingproperty, 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 XmlMappingExceptionconvertXmlBeansException(Exception ex, boolean marshalling)已过时。Convert the given XMLBeans exception to an appropriate exception from theorg.springframework.oxmhierarchy.org.apache.xmlbeans.XmlOptionsgetXmlOptions()已过时。Return theXmlOptions.booleanisValidating()已过时。Return whether this marshaller should validate in- and outgoing documents.protected voidmarshalDomNode(Object graph, Node node)已过时。Abstract template method for marshalling the given object graph to a DOMNode.protected voidmarshalOutputStream(Object graph, OutputStream outputStream)已过时。Abstract template method for marshalling the given object graph to aOutputStream.protected voidmarshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)已过时。Abstract template method for marshalling the given object graph to a SAXContentHandler.protected voidmarshalWriter(Object graph, Writer writer)已过时。Abstract template method for marshalling the given object graph to aWriter.protected voidmarshalXmlEventWriter(Object graph, XMLEventWriter eventWriter)已过时。Abstract template method for marshalling the given object to a StAXXMLEventWriter.protected voidmarshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter)已过时。Abstract template method for marshalling the given object to a StAXXMLStreamWriter.voidsetValidating(boolean validating)已过时。Set whether this marshaller should validate in- and outgoing documents.voidsetXmlOptions(org.apache.xmlbeans.XmlOptions xmlOptions)已过时。Set theXmlOptions.booleansupports(Class<?> clazz)已过时。This implementation returns true if the given class is an implementation ofXmlObject.protected ObjectunmarshalDomNode(Node node)已过时。Abstract template method for unmarshalling from a given DOMNode.protected ObjectunmarshalInputStream(InputStream inputStream)已过时。Abstract template method for unmarshalling from a givenInputStream.protected ObjectunmarshalReader(Reader reader)已过时。Abstract template method for unmarshalling from a givenReader.protected ObjectunmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)已过时。Abstract template method for unmarshalling using a given SAXXMLReaderandInputSource.protected ObjectunmarshalXmlEventReader(XMLEventReader eventReader)已过时。Abstract template method for unmarshalling from a given StaxXMLEventReader.protected ObjectunmarshalXmlStreamReader(XMLStreamReader streamReader)已过时。Abstract template method for unmarshalling from a given StaxXMLStreamReader.protected voidvalidate(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- 返回:
trueif this marshaller can indeed marshal instances of the supplied class;falseotherwise
marshalDomNode
protected void marshalDomNode(Object graph, Node node) throws XmlMappingException
已过时。从类复制的说明:AbstractMarshallerAbstract template method for marshalling the given object graph to a DOMNode.In practice, node is be a
Documentnode, aDocumentFragmentnode, or aElementnode. 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)
已过时。从类复制的说明:AbstractMarshallerAbstract template method for marshalling the given object to a StAXXMLEventWriter.- 指定者:
marshalXmlEventWriter在类中AbstractMarshaller- 参数:
graph- the root of the object graph to marshaleventWriter- theXMLEventWriterto write to
marshalXmlStreamWriter
protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException
已过时。从类复制的说明:AbstractMarshallerAbstract template method for marshalling the given object to a StAXXMLStreamWriter.- 指定者:
marshalXmlStreamWriter在类中AbstractMarshaller- 参数:
graph- the root of the object graph to marshalstreamWriter- theXMLStreamWriterto 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
已过时。从类复制的说明:AbstractMarshallerAbstract template method for marshalling the given object graph to a SAXContentHandler.- 指定者:
marshalSaxHandlers在类中AbstractMarshaller- 参数:
graph- the root of the object graph to marshalcontentHandler- the SAXContentHandlerlexicalHandler- 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
已过时。从类复制的说明:AbstractMarshallerAbstract template method for marshalling the given object graph to aOutputStream.- 指定者:
marshalOutputStream在类中AbstractMarshaller- 参数:
graph- the root of the object graph to marshaloutputStream- theOutputStreamto 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
已过时。从类复制的说明:AbstractMarshallerAbstract template method for marshalling the given object graph to aWriter.- 指定者:
marshalWriter在类中AbstractMarshaller- 参数:
graph- the root of the object graph to marshalwriter- theWriterto 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
已过时。从类复制的说明:AbstractMarshallerAbstract 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
已过时。从类复制的说明:AbstractMarshallerAbstract template method for unmarshalling from a given StaxXMLEventReader.- 指定者:
unmarshalXmlEventReader在类中AbstractMarshaller- 参数:
eventReader- theXMLEventReaderto 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
已过时。从类复制的说明:AbstractMarshallerAbstract template method for unmarshalling from a given StaxXMLStreamReader.- 指定者:
unmarshalXmlStreamReader在类中AbstractMarshaller- 参数:
streamReader- theXMLStreamReaderto 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
已过时。从类复制的说明:AbstractMarshallerAbstract template method for unmarshalling using a given SAXXMLReaderandInputSource.- 指定者:
unmarshalSaxReader在类中AbstractMarshaller- 参数:
xmlReader- the SAXXMLReaderto 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
已过时。从类复制的说明:AbstractMarshallerAbstract template method for unmarshalling from a givenInputStream.- 指定者:
unmarshalInputStream在类中AbstractMarshaller- 参数:
inputStream- theInputStreamStreamto 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
已过时。从类复制的说明:AbstractMarshallerAbstract template method for unmarshalling from a givenReader.- 指定者:
unmarshalReader在类中AbstractMarshaller- 参数:
reader- theReaderto 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.oxmhierarchy.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