类 CastorMarshaller
- java.lang.Object
- org.springframework.oxm.support.AbstractMarshaller
- org.springframework.oxm.castor.CastorMarshaller
- 所有已实现的接口:
Aware
,BeanClassLoaderAware
,InitializingBean
,Marshaller
,Unmarshaller
@Deprecated public class CastorMarshaller extends AbstractMarshaller implements InitializingBean, BeanClassLoaderAware
已过时。as of Spring Framework 4.3.13, due to the lack of activity on the Castor projectImplementation of theMarshaller
interface for Castor. By default, Castor does not require any further configuration, though setting target classes, target packages or providing a mapping file can be used to have more control over the behavior of Castor.If a target class is specified using
setTargetClass
, theCastorMarshaller
can only be used to unmarshal XML that represents that specific class. If you want to unmarshal multiple classes, you have to provide a mapping file usingsetMappingLocations
.Due to limitations of Castor's API, it is required to set the encoding used for writing to output streams. It defaults to
UTF-8
.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma, Jakub Narloch, Juergen Hoeller
- 另请参阅:
setEncoding(String)
,setTargetClass(Class)
,setTargetPackages(String[])
,setMappingLocation(Resource)
,setMappingLocations(Resource[])
字段概要
字段 修饰符和类型 字段 说明 static String
DEFAULT_ENCODING
已过时。The default encoding used for stream access: UTF-8.从类继承的字段 org.springframework.oxm.support.AbstractMarshaller
logger
构造器概要
构造器 构造器 说明 CastorMarshaller()
已过时。
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
已过时。Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.protected XmlMappingException
convertCastorException(org.exolab.castor.xml.XMLException ex, boolean marshalling)
已过时。Convert the givenXMLException
to an appropriate exception from theorg.springframework.oxm
hierarchy.protected org.exolab.castor.xml.XMLContext
createXMLContext(Resource[] mappingLocations, Class<?>[] targetClasses, String[] targetPackages)
已过时。Create the CastorXMLContext
.protected void
customizeMarshaller(org.exolab.castor.xml.Marshaller marshaller)
已过时。Template method that allows for customizing of the given CastorMarshaller
.protected void
customizeUnmarshaller(org.exolab.castor.xml.Unmarshaller unmarshaller)
已过时。Template method that allows for customizing of the given CastorUnmarshaller
.protected String
getDefaultEncoding()
已过时。Determine the default encoding to use for marshalling or unmarshalling from a byte stream, ornull
if none.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
setBeanClassLoader(ClassLoader classLoader)
已过时。Callback that supplies the beanclass loader
to a bean instance.void
setCastorProperties(Map<String,String> castorProperties)
已过时。Set Castor-specific properties for marshalling and unmarshalling.void
setClassDescriptorResolver(org.exolab.castor.xml.XMLClassDescriptorResolver classDescriptorResolver)
已过时。Set theXMLClassDescriptorResolver
to be used during unmarshalling.void
setClearCollections(boolean clearCollections)
已过时。Sets whether this unmarshaller should clear collections upon the first use.void
setDoctypes(Map<String,String> doctypes)
已过时。Set the map containing document type definition for the marshaller.void
setEncoding(String encoding)
已过时。Set the encoding to be used for stream access.void
setEntityResolver(EntityResolver entityResolver)
已过时。Set theEntityResolver
to be used during unmarshalling.void
setIdResolver(org.exolab.castor.xml.IDResolver idResolver)
已过时。Set the CastorIDResolver
to be used during unmarshalling.void
setIgnoreExtraAttributes(boolean ignoreExtraAttributes)
已过时。Set whether the CastorUnmarshaller
should ignore attributes that do not match a specific field.void
setIgnoreExtraElements(boolean ignoreExtraElements)
已过时。Set whether the CastorUnmarshaller
should ignore elements that do not match a specific field.void
setMappingLocation(Resource mappingLocation)
已过时。Set the locations of the Castor XML mapping files.void
setMappingLocations(Resource... mappingLocations)
已过时。Set the locations of the Castor XML mapping files.void
setMarshalAsDocument(boolean marshalAsDocument)
已过时。Set whether this marshaller should output the xml declaration.void
setMarshalExtendedType(boolean marshalExtendedType)
已过时。Set whether this marshaller should output for given type thexsi:type
attribute.void
setNamespaceMappings(Map<String,String> namespaceMappings)
已过时。Set the namespace mappings.void
setNamespaceToPackageMapping(Map<String,String> namespaceToPackageMapping)
已过时。Set the namespace to package mappings.void
setNoNamespaceSchemaLocation(String noNamespaceSchemaLocation)
已过时。Set the value ofxsi:noNamespaceSchemaLocation
attribute.void
setObjectFactory(org.exolab.castor.util.ObjectFactory objectFactory)
已过时。Set the CastorObjectFactory
to be used during unmarshalling.void
setProcessingInstructions(Map<String,String> processingInstructions)
已过时。Sets the processing instructions that will be used by during marshalling.void
setReuseObjects(boolean reuseObjects)
已过时。Set whether this unmarshaller should re-use objects.void
setRootElement(String rootElement)
已过时。Set the name of the root element.void
setRootObject(Object root)
已过时。Set the expected root object for the unmarshaller, into which the source will be unmarshalled.void
setSchemaLocation(String schemaLocation)
已过时。Set the value ofxsi:schemaLocation
attribute.void
setSuppressNamespaces(boolean suppressNamespaces)
已过时。Sets whether this marshaller should output namespaces.void
setSuppressXsiType(boolean suppressXsiType)
已过时。Set whether this marshaller should output thexsi:type
attribute.void
setTargetClass(Class<?> targetClass)
已过时。Set the Castor target class.void
setTargetClasses(Class<?>... targetClasses)
已过时。Set the Castor target classes.void
setTargetPackage(String targetPackage)
已过时。Set the name of a package with the Castor descriptor classes.void
setTargetPackages(String... targetPackages)
已过时。Set the names of packages with the Castor descriptor classes.void
setUseXSITypeAtRoot(boolean useXSITypeAtRoot)
已过时。Sets whether this marshaller should output thexsi:type
attribute for the root element.void
setValidating(boolean validating)
已过时。Set whether this marshaller should validate in- and outgoing documents.void
setWhitespacePreserve(boolean whitespacePreserve)
已过时。Set whether the CastorUnmarshaller
should preserve "ignorable" whitespace.boolean
supports(Class<?> clazz)
已过时。Returnstrue
for all classes, i.e.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
.从类继承的方法 org.springframework.oxm.support.AbstractMarshaller
buildDocument, createDocumentBuilder, createDocumentBuilderFactory, createXmlReader, isProcessExternalEntities, isSupportDtd, marshal, marshalDomResult, marshalSaxResult, marshalStaxResult, marshalStreamResult, setProcessExternalEntities, setSupportDtd, unmarshal, unmarshalDomSource, unmarshalSaxSource, unmarshalStaxSource, unmarshalStreamSource
字段详细资料
DEFAULT_ENCODING
public static final String DEFAULT_ENCODING
已过时。The default encoding used for stream access: UTF-8.- 另请参阅:
- 常量字段值
构造器详细资料
CastorMarshaller
public CastorMarshaller()
已过时。
方法详细资料
setEncoding
public void setEncoding(String encoding)
已过时。Set the encoding to be used for stream access.- 另请参阅:
DEFAULT_ENCODING
getDefaultEncoding
protected String getDefaultEncoding()
已过时。从类复制的说明:AbstractMarshaller
Determine the default encoding to use for marshalling or unmarshalling from a byte stream, ornull
if none.The default implementation returns
null
.
setMappingLocation
public void setMappingLocation(Resource mappingLocation)
已过时。Set the locations of the Castor XML mapping files.
setMappingLocations
public void setMappingLocations(Resource... mappingLocations)
已过时。Set the locations of the Castor XML mapping files.
setTargetClass
public void setTargetClass(Class<?> targetClass)
已过时。Set the Castor target class.
setTargetClasses
public void setTargetClasses(Class<?>... targetClasses)
已过时。Set the Castor target classes.
setTargetPackage
public void setTargetPackage(String targetPackage)
已过时。Set the name of a package with the Castor descriptor classes.
setTargetPackages
public void setTargetPackages(String... targetPackages)
已过时。Set the names of packages with the Castor descriptor classes.
setValidating
public void setValidating(boolean validating)
已过时。Set whether this marshaller should validate in- and outgoing documents.Default is
false
.- 另请参阅:
Marshaller.setValidation(boolean)
setSuppressNamespaces
public void setSuppressNamespaces(boolean suppressNamespaces)
已过时。Sets whether this marshaller should output namespaces.The default is
false
, i.e. namespaces are written.- 另请参阅:
Marshaller.setSuppressNamespaces(boolean)
setSuppressXsiType
public void setSuppressXsiType(boolean suppressXsiType)
已过时。Set whether this marshaller should output thexsi:type
attribute.The default is
false
, i.e. thexsi:type
is written.- 另请参阅:
Marshaller.setSuppressXSIType(boolean)
setMarshalAsDocument
public void setMarshalAsDocument(boolean marshalAsDocument)
已过时。Set whether this marshaller should output the xml declaration.The default is
true
, the XML declaration will be written.- 另请参阅:
Marshaller.setMarshalAsDocument(boolean)
setMarshalExtendedType
public void setMarshalExtendedType(boolean marshalExtendedType)
已过时。Set whether this marshaller should output for given type thexsi:type
attribute.The default is
true
, thexsi:type
attribute will be written.- 另请参阅:
Marshaller.setMarshalExtendedType(boolean)
setRootElement
public void setRootElement(String rootElement)
已过时。Set the name of the root element.- 另请参阅:
Marshaller.setRootElement(String)
setNoNamespaceSchemaLocation
public void setNoNamespaceSchemaLocation(String noNamespaceSchemaLocation)
已过时。Set the value ofxsi:noNamespaceSchemaLocation
attribute. When set, thexsi:noNamespaceSchemaLocation
attribute will be written for the root element.- 另请参阅:
Marshaller.setNoNamespaceSchemaLocation(String)
setSchemaLocation
public void setSchemaLocation(String schemaLocation)
已过时。Set the value ofxsi:schemaLocation
attribute. When set, thexsi:schemaLocation
attribute will be written for the root element.- 另请参阅:
Marshaller.setSchemaLocation(String)
setUseXSITypeAtRoot
public void setUseXSITypeAtRoot(boolean useXSITypeAtRoot)
已过时。Sets whether this marshaller should output thexsi:type
attribute for the root element. This can be useful when the type of the element can not be simply determined from the element name.The default is
false
: Thexsi:type
attribute for the root element won't be written.- 另请参阅:
Marshaller.setUseXSITypeAtRoot(boolean)
setWhitespacePreserve
public void setWhitespacePreserve(boolean whitespacePreserve)
已过时。Set whether the CastorUnmarshaller
should preserve "ignorable" whitespace.Default is
false
.- 另请参阅:
Unmarshaller.setWhitespacePreserve(boolean)
setIgnoreExtraAttributes
public void setIgnoreExtraAttributes(boolean ignoreExtraAttributes)
已过时。Set whether the CastorUnmarshaller
should ignore attributes that do not match a specific field.Default is
true
: Extra attributes are ignored.- 另请参阅:
Unmarshaller.setIgnoreExtraAttributes(boolean)
setIgnoreExtraElements
public void setIgnoreExtraElements(boolean ignoreExtraElements)
已过时。Set whether the CastorUnmarshaller
should ignore elements that do not match a specific field.Default is
false
: Extra elements are flagged as an error.- 另请参阅:
Unmarshaller.setIgnoreExtraElements(boolean)
setRootObject
public void setRootObject(Object root)
已过时。Set the expected root object for the unmarshaller, into which the source will be unmarshalled.- 另请参阅:
Unmarshaller.setObject(Object)
setReuseObjects
public void setReuseObjects(boolean reuseObjects)
已过时。Set whether this unmarshaller should re-use objects. This will be only used when unmarshalling to an existing object.The default is
false
, which means that the objects won't be re-used.- 另请参阅:
Unmarshaller.setReuseObjects(boolean)
setClearCollections
public void setClearCollections(boolean clearCollections)
已过时。Sets whether this unmarshaller should clear collections upon the first use.The default is
false
which means that marshaller won't clear collections.- 另请参阅:
Unmarshaller.setClearCollections(boolean)
setCastorProperties
public void setCastorProperties(Map<String,String> castorProperties)
已过时。Set Castor-specific properties for marshalling and unmarshalling. Each entry key is considered the property name and each value the property value.- 另请参阅:
Marshaller.setProperty(String, String)
,Unmarshaller.setProperty(String, String)
setDoctypes
public void setDoctypes(Map<String,String> doctypes)
已过时。Set the map containing document type definition for the marshaller. Each entry has system id as key and public id as value.- 另请参阅:
Marshaller.setDoctype(String, String)
setProcessingInstructions
public void setProcessingInstructions(Map<String,String> processingInstructions)
已过时。Sets the processing instructions that will be used by during marshalling. Keys are the processing targets and values contain the processing data.- 另请参阅:
Marshaller.addProcessingInstruction(String, String)
setNamespaceMappings
public void setNamespaceMappings(Map<String,String> namespaceMappings)
已过时。Set the namespace mappings. Property names are interpreted as namespace prefixes; values are namespace URIs.- 另请参阅:
Marshaller.setNamespaceMapping(String, String)
setNamespaceToPackageMapping
public void setNamespaceToPackageMapping(Map<String,String> namespaceToPackageMapping)
已过时。Set the namespace to package mappings. Property names are represents the namespaces URI, values are packages.- 另请参阅:
Marshaller.setNamespaceMapping(String, String)
setEntityResolver
public void setEntityResolver(EntityResolver entityResolver)
已过时。Set theEntityResolver
to be used during unmarshalling. This resolver will used to resolve system and public ids.- 另请参阅:
Unmarshaller.setEntityResolver(EntityResolver)
setClassDescriptorResolver
public void setClassDescriptorResolver(org.exolab.castor.xml.XMLClassDescriptorResolver classDescriptorResolver)
已过时。Set theXMLClassDescriptorResolver
to be used during unmarshalling. This resolver will used to resolve class descriptors.- 另请参阅:
Unmarshaller.setResolver(XMLClassDescriptorResolver)
setIdResolver
public void setIdResolver(org.exolab.castor.xml.IDResolver idResolver)
已过时。Set the CastorIDResolver
to be used during unmarshalling.- 另请参阅:
Unmarshaller.setIDResolver(IDResolver)
setObjectFactory
public void setObjectFactory(org.exolab.castor.util.ObjectFactory objectFactory)
已过时。Set the CastorObjectFactory
to be used during unmarshalling.- 另请参阅:
Unmarshaller.setObjectFactory(ObjectFactory)
setBeanClassLoader
public void setBeanClassLoader(ClassLoader classLoader)
已过时。从接口复制的说明:BeanClassLoaderAware
Callback that supplies the beanclass loader
to a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as
InitializingBean's
InitializingBean.afterPropertiesSet()
method or a custom init-method.- 指定者:
setBeanClassLoader
在接口中BeanClassLoaderAware
- 参数:
classLoader
- the owning class loader; may benull
in which case a defaultClassLoader
must be used, for example theClassLoader
obtained viaClassUtils.getDefaultClassLoader()
afterPropertiesSet
public void afterPropertiesSet() throws CastorMappingException, IOException
已过时。从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
createXMLContext
protected org.exolab.castor.xml.XMLContext createXMLContext(Resource[] mappingLocations, Class<?>[] targetClasses, String[] targetPackages) throws org.exolab.castor.mapping.MappingException, org.exolab.castor.xml.ResolverException, IOException
已过时。Create the CastorXMLContext
. Subclasses can override this to create a custom context.The default implementation loads mapping files if defined, or the target class or packages if defined.
- 返回:
- the created resolver
- 抛出:
org.exolab.castor.mapping.MappingException
- when the mapping file cannot be loadedIOException
- in case of I/O errorsorg.exolab.castor.xml.ResolverException
- 另请参阅:
XMLContext.addMapping(org.exolab.castor.mapping.Mapping)
,XMLContext.addClass(Class)
supports
public boolean supports(Class<?> clazz)
已过时。Returnstrue
for all classes, i.e. Castor supports arbitrary classes.- 指定者:
supports
在接口中Marshaller
- 指定者:
supports
在接口中Unmarshaller
- 参数:
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) throws XmlMappingException
已过时。从类复制的说明: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- 抛出:
XmlMappingException
- if the given object cannot be marshalled to the DOM node
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
customizeMarshaller
protected void customizeMarshaller(org.exolab.castor.xml.Marshaller marshaller)
已过时。Template method that allows for customizing of the given CastorMarshaller
.
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)
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for unmarshalling from a given StaxXMLEventReader
.- 指定者:
unmarshalXmlEventReader
在类中AbstractMarshaller
- 参数:
eventReader
- theXMLEventReader
to read from- 返回:
- the object graph
unmarshalXmlStreamReader
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader)
已过时。从类复制的说明:AbstractMarshaller
Abstract template method for unmarshalling from a given StaxXMLStreamReader
.- 指定者:
unmarshalXmlStreamReader
在类中AbstractMarshaller
- 参数:
streamReader
- theXMLStreamReader
to read from- 返回:
- the object graph
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
customizeUnmarshaller
protected void customizeUnmarshaller(org.exolab.castor.xml.Unmarshaller unmarshaller)
已过时。Template method that allows for customizing of the given CastorUnmarshaller
.
convertCastorException
protected XmlMappingException convertCastorException(org.exolab.castor.xml.XMLException ex, boolean marshalling)
已过时。Convert the givenXMLException
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 Castor itself does not make this distinction in its exception hierarchy.
- 参数:
ex
- CastorXMLException
that occurredmarshalling
- indicates whether the exception occurs during marshalling (true
), or unmarshalling (false
)- 返回:
- the corresponding
XmlMappingException