Class CastorMarshaller
- java.lang.Object
- org.springframework.oxm.support.AbstractMarshaller
- org.springframework.oxm.castor.CastorMarshaller
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,InitializingBean
,Marshaller
,Unmarshaller
@Deprecated public class CastorMarshaller extends AbstractMarshaller implements InitializingBean, BeanClassLoaderAware
Deprecated.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
.- Since:
- 3.0
- Author:
- Arjen Poutsma, Jakub Narloch, Juergen Hoeller
- See Also:
setEncoding(String)
,setTargetClass(Class)
,setTargetPackages(String[])
,setMappingLocation(Resource)
,setMappingLocations(Resource[])
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_ENCODING
Deprecated.The default encoding used for stream access: UTF-8.Fields inherited from class org.springframework.oxm.support.AbstractMarshaller
logger
Constructor Summary
Constructors Constructor Description CastorMarshaller()
Deprecated.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
afterPropertiesSet()
Deprecated.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)
Deprecated.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)
Deprecated.Create the CastorXMLContext
.protected void
customizeMarshaller(org.exolab.castor.xml.Marshaller marshaller)
Deprecated.Template method that allows for customizing of the given CastorMarshaller
.protected void
customizeUnmarshaller(org.exolab.castor.xml.Unmarshaller unmarshaller)
Deprecated.Template method that allows for customizing of the given CastorUnmarshaller
.protected String
getDefaultEncoding()
Deprecated.Determine the default encoding to use for marshalling or unmarshalling from a byte stream, ornull
if none.protected void
marshalDomNode(Object graph, Node node)
Deprecated.Abstract template method for marshalling the given object graph to a DOMNode
.protected void
marshalOutputStream(Object graph, OutputStream outputStream)
Deprecated.Abstract template method for marshalling the given object graph to aOutputStream
.protected void
marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
Deprecated.Abstract template method for marshalling the given object graph to a SAXContentHandler
.protected void
marshalWriter(Object graph, Writer writer)
Deprecated.Abstract template method for marshalling the given object graph to aWriter
.protected void
marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter)
Deprecated.Abstract template method for marshalling the given object to a StAXXMLEventWriter
.protected void
marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter)
Deprecated.Abstract template method for marshalling the given object to a StAXXMLStreamWriter
.void
setBeanClassLoader(ClassLoader classLoader)
Deprecated.Callback that supplies the beanclass loader
to a bean instance.void
setCastorProperties(Map<String,String> castorProperties)
Deprecated.Set Castor-specific properties for marshalling and unmarshalling.void
setClassDescriptorResolver(org.exolab.castor.xml.XMLClassDescriptorResolver classDescriptorResolver)
Deprecated.Set theXMLClassDescriptorResolver
to be used during unmarshalling.void
setClearCollections(boolean clearCollections)
Deprecated.Sets whether this unmarshaller should clear collections upon the first use.void
setDoctypes(Map<String,String> doctypes)
Deprecated.Set the map containing document type definition for the marshaller.void
setEncoding(String encoding)
Deprecated.Set the encoding to be used for stream access.void
setEntityResolver(EntityResolver entityResolver)
Deprecated.Set theEntityResolver
to be used during unmarshalling.void
setIdResolver(org.exolab.castor.xml.IDResolver idResolver)
Deprecated.Set the CastorIDResolver
to be used during unmarshalling.void
setIgnoreExtraAttributes(boolean ignoreExtraAttributes)
Deprecated.Set whether the CastorUnmarshaller
should ignore attributes that do not match a specific field.void
setIgnoreExtraElements(boolean ignoreExtraElements)
Deprecated.Set whether the CastorUnmarshaller
should ignore elements that do not match a specific field.void
setMappingLocation(Resource mappingLocation)
Deprecated.Set the locations of the Castor XML mapping files.void
setMappingLocations(Resource... mappingLocations)
Deprecated.Set the locations of the Castor XML mapping files.void
setMarshalAsDocument(boolean marshalAsDocument)
Deprecated.Set whether this marshaller should output the xml declaration.void
setMarshalExtendedType(boolean marshalExtendedType)
Deprecated.Set whether this marshaller should output for given type thexsi:type
attribute.void
setNamespaceMappings(Map<String,String> namespaceMappings)
Deprecated.Set the namespace mappings.void
setNamespaceToPackageMapping(Map<String,String> namespaceToPackageMapping)
Deprecated.Set the namespace to package mappings.void
setNoNamespaceSchemaLocation(String noNamespaceSchemaLocation)
Deprecated.Set the value ofxsi:noNamespaceSchemaLocation
attribute.void
setObjectFactory(org.exolab.castor.util.ObjectFactory objectFactory)
Deprecated.Set the CastorObjectFactory
to be used during unmarshalling.void
setProcessingInstructions(Map<String,String> processingInstructions)
Deprecated.Sets the processing instructions that will be used by during marshalling.void
setReuseObjects(boolean reuseObjects)
Deprecated.Set whether this unmarshaller should re-use objects.void
setRootElement(String rootElement)
Deprecated.Set the name of the root element.void
setRootObject(Object root)
Deprecated.Set the expected root object for the unmarshaller, into which the source will be unmarshalled.void
setSchemaLocation(String schemaLocation)
Deprecated.Set the value ofxsi:schemaLocation
attribute.void
setSuppressNamespaces(boolean suppressNamespaces)
Deprecated.Sets whether this marshaller should output namespaces.void
setSuppressXsiType(boolean suppressXsiType)
Deprecated.Set whether this marshaller should output thexsi:type
attribute.void
setTargetClass(Class<?> targetClass)
Deprecated.Set the Castor target class.void
setTargetClasses(Class<?>... targetClasses)
Deprecated.Set the Castor target classes.void
setTargetPackage(String targetPackage)
Deprecated.Set the name of a package with the Castor descriptor classes.void
setTargetPackages(String... targetPackages)
Deprecated.Set the names of packages with the Castor descriptor classes.void
setUseXSITypeAtRoot(boolean useXSITypeAtRoot)
Deprecated.Sets whether this marshaller should output thexsi:type
attribute for the root element.void
setValidating(boolean validating)
Deprecated.Set whether this marshaller should validate in- and outgoing documents.void
setWhitespacePreserve(boolean whitespacePreserve)
Deprecated.Set whether the CastorUnmarshaller
should preserve "ignorable" whitespace.boolean
supports(Class<?> clazz)
Deprecated.Returnstrue
for all classes, i.e.protected Object
unmarshalDomNode(Node node)
Deprecated.Abstract template method for unmarshalling from a given DOMNode
.protected Object
unmarshalInputStream(InputStream inputStream)
Deprecated.Abstract template method for unmarshalling from a givenInputStream
.protected Object
unmarshalReader(Reader reader)
Deprecated.Abstract template method for unmarshalling from a givenReader
.protected Object
unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
Deprecated.Abstract template method for unmarshalling using a given SAXXMLReader
andInputSource
.protected Object
unmarshalXmlEventReader(XMLEventReader eventReader)
Deprecated.Abstract template method for unmarshalling from a given StaxXMLEventReader
.protected Object
unmarshalXmlStreamReader(XMLStreamReader streamReader)
Deprecated.Abstract template method for unmarshalling from a given StaxXMLStreamReader
.Methods inherited from class org.springframework.oxm.support.AbstractMarshaller
buildDocument, createDocumentBuilder, createDocumentBuilderFactory, createXmlReader, isProcessExternalEntities, isSupportDtd, marshal, marshalDomResult, marshalSaxResult, marshalStaxResult, marshalStreamResult, setProcessExternalEntities, setSupportDtd, unmarshal, unmarshalDomSource, unmarshalSaxSource, unmarshalStaxSource, unmarshalStreamSource
Field Detail
DEFAULT_ENCODING
public static final String DEFAULT_ENCODING
Deprecated.The default encoding used for stream access: UTF-8.- See Also:
- Constant Field Values
Constructor Detail
CastorMarshaller
public CastorMarshaller()
Deprecated.
Method Detail
setEncoding
public void setEncoding(String encoding)
Deprecated.Set the encoding to be used for stream access.- See Also:
DEFAULT_ENCODING
getDefaultEncoding
protected String getDefaultEncoding()
Deprecated.Description copied from class:AbstractMarshaller
Determine the default encoding to use for marshalling or unmarshalling from a byte stream, ornull
if none.The default implementation returns
null
.- Overrides:
getDefaultEncoding
in classAbstractMarshaller
setMappingLocation
public void setMappingLocation(Resource mappingLocation)
Deprecated.Set the locations of the Castor XML mapping files.
setMappingLocations
public void setMappingLocations(Resource... mappingLocations)
Deprecated.Set the locations of the Castor XML mapping files.
setTargetClass
public void setTargetClass(Class<?> targetClass)
Deprecated.Set the Castor target class.
setTargetClasses
public void setTargetClasses(Class<?>... targetClasses)
Deprecated.Set the Castor target classes.
setTargetPackage
public void setTargetPackage(String targetPackage)
Deprecated.Set the name of a package with the Castor descriptor classes.
setTargetPackages
public void setTargetPackages(String... targetPackages)
Deprecated.Set the names of packages with the Castor descriptor classes.
setValidating
public void setValidating(boolean validating)
Deprecated.Set whether this marshaller should validate in- and outgoing documents.Default is
false
.- See Also:
Marshaller.setValidation(boolean)
setSuppressNamespaces
public void setSuppressNamespaces(boolean suppressNamespaces)
Deprecated.Sets whether this marshaller should output namespaces.The default is
false
, i.e. namespaces are written.- See Also:
Marshaller.setSuppressNamespaces(boolean)
setSuppressXsiType
public void setSuppressXsiType(boolean suppressXsiType)
Deprecated.Set whether this marshaller should output thexsi:type
attribute.The default is
false
, i.e. thexsi:type
is written.- See Also:
Marshaller.setSuppressXSIType(boolean)
setMarshalAsDocument
public void setMarshalAsDocument(boolean marshalAsDocument)
Deprecated.Set whether this marshaller should output the xml declaration.The default is
true
, the XML declaration will be written.- See Also:
Marshaller.setMarshalAsDocument(boolean)
setMarshalExtendedType
public void setMarshalExtendedType(boolean marshalExtendedType)
Deprecated.Set whether this marshaller should output for given type thexsi:type
attribute.The default is
true
, thexsi:type
attribute will be written.- See Also:
Marshaller.setMarshalExtendedType(boolean)
setRootElement
public void setRootElement(String rootElement)
Deprecated.Set the name of the root element.- See Also:
Marshaller.setRootElement(String)
setNoNamespaceSchemaLocation
public void setNoNamespaceSchemaLocation(String noNamespaceSchemaLocation)
Deprecated.Set the value ofxsi:noNamespaceSchemaLocation
attribute. When set, thexsi:noNamespaceSchemaLocation
attribute will be written for the root element.- See Also:
Marshaller.setNoNamespaceSchemaLocation(String)
setSchemaLocation
public void setSchemaLocation(String schemaLocation)
Deprecated.Set the value ofxsi:schemaLocation
attribute. When set, thexsi:schemaLocation
attribute will be written for the root element.- See Also:
Marshaller.setSchemaLocation(String)
setUseXSITypeAtRoot
public void setUseXSITypeAtRoot(boolean useXSITypeAtRoot)
Deprecated.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.- See Also:
Marshaller.setUseXSITypeAtRoot(boolean)
setWhitespacePreserve
public void setWhitespacePreserve(boolean whitespacePreserve)
Deprecated.Set whether the CastorUnmarshaller
should preserve "ignorable" whitespace.Default is
false
.- See Also:
Unmarshaller.setWhitespacePreserve(boolean)
setIgnoreExtraAttributes
public void setIgnoreExtraAttributes(boolean ignoreExtraAttributes)
Deprecated.Set whether the CastorUnmarshaller
should ignore attributes that do not match a specific field.Default is
true
: Extra attributes are ignored.- See Also:
Unmarshaller.setIgnoreExtraAttributes(boolean)
setIgnoreExtraElements
public void setIgnoreExtraElements(boolean ignoreExtraElements)
Deprecated.Set whether the CastorUnmarshaller
should ignore elements that do not match a specific field.Default is
false
: Extra elements are flagged as an error.- See Also:
Unmarshaller.setIgnoreExtraElements(boolean)
setRootObject
public void setRootObject(Object root)
Deprecated.Set the expected root object for the unmarshaller, into which the source will be unmarshalled.- See Also:
Unmarshaller.setObject(Object)
setReuseObjects
public void setReuseObjects(boolean reuseObjects)
Deprecated.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.- See Also:
Unmarshaller.setReuseObjects(boolean)
setClearCollections
public void setClearCollections(boolean clearCollections)
Deprecated.Sets whether this unmarshaller should clear collections upon the first use.The default is
false
which means that marshaller won't clear collections.- See Also:
Unmarshaller.setClearCollections(boolean)
setCastorProperties
public void setCastorProperties(Map<String,String> castorProperties)
Deprecated.Set Castor-specific properties for marshalling and unmarshalling. Each entry key is considered the property name and each value the property value.- See Also:
Marshaller.setProperty(String, String)
,Unmarshaller.setProperty(String, String)
setDoctypes
public void setDoctypes(Map<String,String> doctypes)
Deprecated.Set the map containing document type definition for the marshaller. Each entry has system id as key and public id as value.- See Also:
Marshaller.setDoctype(String, String)
setProcessingInstructions
public void setProcessingInstructions(Map<String,String> processingInstructions)
Deprecated.Sets the processing instructions that will be used by during marshalling. Keys are the processing targets and values contain the processing data.- See Also:
Marshaller.addProcessingInstruction(String, String)
setNamespaceMappings
public void setNamespaceMappings(Map<String,String> namespaceMappings)
Deprecated.Set the namespace mappings. Property names are interpreted as namespace prefixes; values are namespace URIs.- See Also:
Marshaller.setNamespaceMapping(String, String)
setNamespaceToPackageMapping
public void setNamespaceToPackageMapping(Map<String,String> namespaceToPackageMapping)
Deprecated.Set the namespace to package mappings. Property names are represents the namespaces URI, values are packages.- See Also:
Marshaller.setNamespaceMapping(String, String)
setEntityResolver
public void setEntityResolver(EntityResolver entityResolver)
Deprecated.Set theEntityResolver
to be used during unmarshalling. This resolver will used to resolve system and public ids.- See Also:
Unmarshaller.setEntityResolver(EntityResolver)
setClassDescriptorResolver
public void setClassDescriptorResolver(org.exolab.castor.xml.XMLClassDescriptorResolver classDescriptorResolver)
Deprecated.Set theXMLClassDescriptorResolver
to be used during unmarshalling. This resolver will used to resolve class descriptors.- See Also:
Unmarshaller.setResolver(XMLClassDescriptorResolver)
setIdResolver
public void setIdResolver(org.exolab.castor.xml.IDResolver idResolver)
Deprecated.Set the CastorIDResolver
to be used during unmarshalling.- See Also:
Unmarshaller.setIDResolver(IDResolver)
setObjectFactory
public void setObjectFactory(org.exolab.castor.util.ObjectFactory objectFactory)
Deprecated.Set the CastorObjectFactory
to be used during unmarshalling.- See Also:
Unmarshaller.setObjectFactory(ObjectFactory)
setBeanClassLoader
public void setBeanClassLoader(ClassLoader classLoader)
Deprecated.Description copied from interface: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.- Specified by:
setBeanClassLoader
in interfaceBeanClassLoaderAware
- Parameters:
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
Deprecated.Description copied from interface: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.
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
CastorMappingException
IOException
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
Deprecated.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.
- Returns:
- the created resolver
- Throws:
org.exolab.castor.mapping.MappingException
- when the mapping file cannot be loadedIOException
- in case of I/O errorsorg.exolab.castor.xml.ResolverException
- See Also:
XMLContext.addMapping(org.exolab.castor.mapping.Mapping)
,XMLContext.addClass(Class)
supports
public boolean supports(Class<?> clazz)
Deprecated.Returnstrue
for all classes, i.e. Castor supports arbitrary classes.- Specified by:
supports
in interfaceMarshaller
- Specified by:
supports
in interfaceUnmarshaller
- Parameters:
clazz
- the class that this marshaller is being asked if it can marshal- Returns:
true
if this marshaller can indeed marshal instances of the supplied class;false
otherwise
marshalDomNode
protected void marshalDomNode(Object graph, Node node) throws XmlMappingException
Deprecated.Description copied from class: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.- Specified by:
marshalDomNode
in classAbstractMarshaller
- Parameters:
graph
- the root of the object graph to marshalnode
- the DOM node that will contain the result tree- Throws:
XmlMappingException
- if the given object cannot be marshalled to the DOM node- See Also:
Document
,DocumentFragment
,Element
marshalXmlEventWriter
protected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) throws XmlMappingException
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for marshalling the given object to a StAXXMLEventWriter
.- Specified by:
marshalXmlEventWriter
in classAbstractMarshaller
- Parameters:
graph
- the root of the object graph to marshaleventWriter
- theXMLEventWriter
to write to- Throws:
XmlMappingException
- if the given object cannot be marshalled to the DOM node
marshalXmlStreamWriter
protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for marshalling the given object to a StAXXMLStreamWriter
.- Specified by:
marshalXmlStreamWriter
in classAbstractMarshaller
- Parameters:
graph
- the root of the object graph to marshalstreamWriter
- theXMLStreamWriter
to write to- Throws:
XmlMappingException
- if the given object cannot be marshalled to the DOM node
marshalSaxHandlers
protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) throws XmlMappingException
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for marshalling the given object graph to a SAXContentHandler
.- Specified by:
marshalSaxHandlers
in classAbstractMarshaller
- Parameters:
graph
- the root of the object graph to marshalcontentHandler
- the SAXContentHandler
lexicalHandler
- the SAX2LexicalHandler
. Can benull
.- Throws:
XmlMappingException
- if the given object cannot be marshalled to the handlers
marshalOutputStream
protected void marshalOutputStream(Object graph, OutputStream outputStream) throws XmlMappingException, IOException
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for marshalling the given object graph to aOutputStream
.- Specified by:
marshalOutputStream
in classAbstractMarshaller
- Parameters:
graph
- the root of the object graph to marshaloutputStream
- theOutputStream
to write to- Throws:
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
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for marshalling the given object graph to aWriter
.- Specified by:
marshalWriter
in classAbstractMarshaller
- Parameters:
graph
- the root of the object graph to marshalwriter
- theWriter
to write to- Throws:
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)
Deprecated.Template method that allows for customizing of the given CastorMarshaller
.
unmarshalDomNode
protected Object unmarshalDomNode(Node node) throws XmlMappingException
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for unmarshalling from a given DOMNode
.- Specified by:
unmarshalDomNode
in classAbstractMarshaller
- Parameters:
node
- the DOM node that contains the objects to be unmarshalled- Returns:
- the object graph
- Throws:
XmlMappingException
- if the given DOM node cannot be mapped to an object
unmarshalXmlEventReader
protected Object unmarshalXmlEventReader(XMLEventReader eventReader)
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for unmarshalling from a given StaxXMLEventReader
.- Specified by:
unmarshalXmlEventReader
in classAbstractMarshaller
- Parameters:
eventReader
- theXMLEventReader
to read from- Returns:
- the object graph
unmarshalXmlStreamReader
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader)
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for unmarshalling from a given StaxXMLStreamReader
.- Specified by:
unmarshalXmlStreamReader
in classAbstractMarshaller
- Parameters:
streamReader
- theXMLStreamReader
to read from- Returns:
- the object graph
unmarshalSaxReader
protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) throws XmlMappingException, IOException
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for unmarshalling using a given SAXXMLReader
andInputSource
.- Specified by:
unmarshalSaxReader
in classAbstractMarshaller
- Parameters:
xmlReader
- the SAXXMLReader
to parse withinputSource
- the input source to parse from- Returns:
- the object graph
- Throws:
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
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for unmarshalling from a givenInputStream
.- Specified by:
unmarshalInputStream
in classAbstractMarshaller
- Parameters:
inputStream
- theInputStreamStream
to read from- Returns:
- the object graph
- Throws:
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
Deprecated.Description copied from class:AbstractMarshaller
Abstract template method for unmarshalling from a givenReader
.- Specified by:
unmarshalReader
in classAbstractMarshaller
- Parameters:
reader
- theReader
to read from- Returns:
- the object graph
- Throws:
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)
Deprecated.Template method that allows for customizing of the given CastorUnmarshaller
.
convertCastorException
protected XmlMappingException convertCastorException(org.exolab.castor.xml.XMLException ex, boolean marshalling)
Deprecated.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.
- Parameters:
ex
- CastorXMLException
that occurredmarshalling
- indicates whether the exception occurs during marshalling (true
), or unmarshalling (false
)- Returns:
- the corresponding
XmlMappingException