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 theMarshallerinterface 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, theCastorMarshallercan 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 StringDEFAULT_ENCODINGDeprecated.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 voidafterPropertiesSet()Deprecated.Invoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.protected XmlMappingExceptionconvertCastorException(org.exolab.castor.xml.XMLException ex, boolean marshalling)Deprecated.Convert the givenXMLExceptionto an appropriate exception from theorg.springframework.oxmhierarchy.protected org.exolab.castor.xml.XMLContextcreateXMLContext(Resource[] mappingLocations, Class<?>[] targetClasses, String[] targetPackages)Deprecated.Create the CastorXMLContext.protected voidcustomizeMarshaller(org.exolab.castor.xml.Marshaller marshaller)Deprecated.Template method that allows for customizing of the given CastorMarshaller.protected voidcustomizeUnmarshaller(org.exolab.castor.xml.Unmarshaller unmarshaller)Deprecated.Template method that allows for customizing of the given CastorUnmarshaller.protected StringgetDefaultEncoding()Deprecated.Determine the default encoding to use for marshalling or unmarshalling from a byte stream, ornullif none.protected voidmarshalDomNode(Object graph, Node node)Deprecated.Abstract template method for marshalling the given object graph to a DOMNode.protected voidmarshalOutputStream(Object graph, OutputStream outputStream)Deprecated.Abstract template method for marshalling the given object graph to aOutputStream.protected voidmarshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)Deprecated.Abstract template method for marshalling the given object graph to a SAXContentHandler.protected voidmarshalWriter(Object graph, Writer writer)Deprecated.Abstract template method for marshalling the given object graph to aWriter.protected voidmarshalXmlEventWriter(Object graph, XMLEventWriter eventWriter)Deprecated.Abstract template method for marshalling the given object to a StAXXMLEventWriter.protected voidmarshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter)Deprecated.Abstract template method for marshalling the given object to a StAXXMLStreamWriter.voidsetBeanClassLoader(ClassLoader classLoader)Deprecated.Callback that supplies the beanclass loaderto a bean instance.voidsetCastorProperties(Map<String,String> castorProperties)Deprecated.Set Castor-specific properties for marshalling and unmarshalling.voidsetClassDescriptorResolver(org.exolab.castor.xml.XMLClassDescriptorResolver classDescriptorResolver)Deprecated.Set theXMLClassDescriptorResolverto be used during unmarshalling.voidsetClearCollections(boolean clearCollections)Deprecated.Sets whether this unmarshaller should clear collections upon the first use.voidsetDoctypes(Map<String,String> doctypes)Deprecated.Set the map containing document type definition for the marshaller.voidsetEncoding(String encoding)Deprecated.Set the encoding to be used for stream access.voidsetEntityResolver(EntityResolver entityResolver)Deprecated.Set theEntityResolverto be used during unmarshalling.voidsetIdResolver(org.exolab.castor.xml.IDResolver idResolver)Deprecated.Set the CastorIDResolverto be used during unmarshalling.voidsetIgnoreExtraAttributes(boolean ignoreExtraAttributes)Deprecated.Set whether the CastorUnmarshallershould ignore attributes that do not match a specific field.voidsetIgnoreExtraElements(boolean ignoreExtraElements)Deprecated.Set whether the CastorUnmarshallershould ignore elements that do not match a specific field.voidsetMappingLocation(Resource mappingLocation)Deprecated.Set the locations of the Castor XML mapping files.voidsetMappingLocations(Resource... mappingLocations)Deprecated.Set the locations of the Castor XML mapping files.voidsetMarshalAsDocument(boolean marshalAsDocument)Deprecated.Set whether this marshaller should output the xml declaration.voidsetMarshalExtendedType(boolean marshalExtendedType)Deprecated.Set whether this marshaller should output for given type thexsi:typeattribute.voidsetNamespaceMappings(Map<String,String> namespaceMappings)Deprecated.Set the namespace mappings.voidsetNamespaceToPackageMapping(Map<String,String> namespaceToPackageMapping)Deprecated.Set the namespace to package mappings.voidsetNoNamespaceSchemaLocation(String noNamespaceSchemaLocation)Deprecated.Set the value ofxsi:noNamespaceSchemaLocationattribute.voidsetObjectFactory(org.exolab.castor.util.ObjectFactory objectFactory)Deprecated.Set the CastorObjectFactoryto be used during unmarshalling.voidsetProcessingInstructions(Map<String,String> processingInstructions)Deprecated.Sets the processing instructions that will be used by during marshalling.voidsetReuseObjects(boolean reuseObjects)Deprecated.Set whether this unmarshaller should re-use objects.voidsetRootElement(String rootElement)Deprecated.Set the name of the root element.voidsetRootObject(Object root)Deprecated.Set the expected root object for the unmarshaller, into which the source will be unmarshalled.voidsetSchemaLocation(String schemaLocation)Deprecated.Set the value ofxsi:schemaLocationattribute.voidsetSuppressNamespaces(boolean suppressNamespaces)Deprecated.Sets whether this marshaller should output namespaces.voidsetSuppressXsiType(boolean suppressXsiType)Deprecated.Set whether this marshaller should output thexsi:typeattribute.voidsetTargetClass(Class<?> targetClass)Deprecated.Set the Castor target class.voidsetTargetClasses(Class<?>... targetClasses)Deprecated.Set the Castor target classes.voidsetTargetPackage(String targetPackage)Deprecated.Set the name of a package with the Castor descriptor classes.voidsetTargetPackages(String... targetPackages)Deprecated.Set the names of packages with the Castor descriptor classes.voidsetUseXSITypeAtRoot(boolean useXSITypeAtRoot)Deprecated.Sets whether this marshaller should output thexsi:typeattribute for the root element.voidsetValidating(boolean validating)Deprecated.Set whether this marshaller should validate in- and outgoing documents.voidsetWhitespacePreserve(boolean whitespacePreserve)Deprecated.Set whether the CastorUnmarshallershould preserve "ignorable" whitespace.booleansupports(Class<?> clazz)Deprecated.Returnstruefor all classes, i.e.protected ObjectunmarshalDomNode(Node node)Deprecated.Abstract template method for unmarshalling from a given DOMNode.protected ObjectunmarshalInputStream(InputStream inputStream)Deprecated.Abstract template method for unmarshalling from a givenInputStream.protected ObjectunmarshalReader(Reader reader)Deprecated.Abstract template method for unmarshalling from a givenReader.protected ObjectunmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)Deprecated.Abstract template method for unmarshalling using a given SAXXMLReaderandInputSource.protected ObjectunmarshalXmlEventReader(XMLEventReader eventReader)Deprecated.Abstract template method for unmarshalling from a given StaxXMLEventReader.protected ObjectunmarshalXmlStreamReader(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:AbstractMarshallerDetermine the default encoding to use for marshalling or unmarshalling from a byte stream, ornullif none.The default implementation returns
null.- Overrides:
getDefaultEncodingin 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:typeattribute.The default is
false, i.e. thexsi:typeis 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:typeattribute.The default is
true, thexsi:typeattribute 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:noNamespaceSchemaLocationattribute. When set, thexsi:noNamespaceSchemaLocationattribute will be written for the root element.- See Also:
Marshaller.setNoNamespaceSchemaLocation(String)
setSchemaLocation
public void setSchemaLocation(String schemaLocation)
Deprecated.Set the value ofxsi:schemaLocationattribute. When set, thexsi:schemaLocationattribute 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:typeattribute 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:typeattribute for the root element won't be written.- See Also:
Marshaller.setUseXSITypeAtRoot(boolean)
setWhitespacePreserve
public void setWhitespacePreserve(boolean whitespacePreserve)
Deprecated.Set whether the CastorUnmarshallershould preserve "ignorable" whitespace.Default is
false.- See Also:
Unmarshaller.setWhitespacePreserve(boolean)
setIgnoreExtraAttributes
public void setIgnoreExtraAttributes(boolean ignoreExtraAttributes)
Deprecated.Set whether the CastorUnmarshallershould 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 CastorUnmarshallershould 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
falsewhich 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 theEntityResolverto 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 theXMLClassDescriptorResolverto 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 CastorIDResolverto be used during unmarshalling.- See Also:
Unmarshaller.setIDResolver(IDResolver)
setObjectFactory
public void setObjectFactory(org.exolab.castor.util.ObjectFactory objectFactory)
Deprecated.Set the CastorObjectFactoryto be used during unmarshalling.- See Also:
Unmarshaller.setObjectFactory(ObjectFactory)
setBeanClassLoader
public void setBeanClassLoader(ClassLoader classLoader)
Deprecated.Description copied from interface:BeanClassLoaderAwareCallback that supplies the beanclass loaderto a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as
InitializingBean'sInitializingBean.afterPropertiesSet()method or a custom init-method.- Specified by:
setBeanClassLoaderin interfaceBeanClassLoaderAware- Parameters:
classLoader- the owning class loader; may benullin which case a defaultClassLoadermust be used, for example theClassLoaderobtained viaClassUtils.getDefaultClassLoader()
afterPropertiesSet
public void afterPropertiesSet() throws CastorMappingException, IOException
Deprecated.Description copied from interface:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.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:
afterPropertiesSetin interfaceInitializingBean- Throws:
CastorMappingExceptionIOException
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.Returnstruefor all classes, i.e. Castor supports arbitrary classes.- Specified by:
supportsin interfaceMarshaller- Specified by:
supportsin interfaceUnmarshaller- Parameters:
clazz- the class that this marshaller is being asked if it can marshal- Returns:
trueif this marshaller can indeed marshal instances of the supplied class;falseotherwise
marshalDomNode
protected void marshalDomNode(Object graph, Node node) throws XmlMappingException
Deprecated.Description copied from class: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.- Specified by:
marshalDomNodein 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:AbstractMarshallerAbstract template method for marshalling the given object to a StAXXMLEventWriter.- Specified by:
marshalXmlEventWriterin classAbstractMarshaller- Parameters:
graph- the root of the object graph to marshaleventWriter- theXMLEventWriterto 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:AbstractMarshallerAbstract template method for marshalling the given object to a StAXXMLStreamWriter.- Specified by:
marshalXmlStreamWriterin classAbstractMarshaller- Parameters:
graph- the root of the object graph to marshalstreamWriter- theXMLStreamWriterto 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:AbstractMarshallerAbstract template method for marshalling the given object graph to a SAXContentHandler.- Specified by:
marshalSaxHandlersin classAbstractMarshaller- Parameters:
graph- the root of the object graph to marshalcontentHandler- the SAXContentHandlerlexicalHandler- 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:AbstractMarshallerAbstract template method for marshalling the given object graph to aOutputStream.- Specified by:
marshalOutputStreamin classAbstractMarshaller- Parameters:
graph- the root of the object graph to marshaloutputStream- theOutputStreamto 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:AbstractMarshallerAbstract template method for marshalling the given object graph to aWriter.- Specified by:
marshalWriterin classAbstractMarshaller- Parameters:
graph- the root of the object graph to marshalwriter- theWriterto 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:AbstractMarshallerAbstract template method for unmarshalling from a given DOMNode.- Specified by:
unmarshalDomNodein 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:AbstractMarshallerAbstract template method for unmarshalling from a given StaxXMLEventReader.- Specified by:
unmarshalXmlEventReaderin classAbstractMarshaller- Parameters:
eventReader- theXMLEventReaderto read from- Returns:
- the object graph
unmarshalXmlStreamReader
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader)
Deprecated.Description copied from class:AbstractMarshallerAbstract template method for unmarshalling from a given StaxXMLStreamReader.- Specified by:
unmarshalXmlStreamReaderin classAbstractMarshaller- Parameters:
streamReader- theXMLStreamReaderto read from- Returns:
- the object graph
unmarshalSaxReader
protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) throws XmlMappingException, IOException
Deprecated.Description copied from class:AbstractMarshallerAbstract template method for unmarshalling using a given SAXXMLReaderandInputSource.- Specified by:
unmarshalSaxReaderin classAbstractMarshaller- Parameters:
xmlReader- the SAXXMLReaderto 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:AbstractMarshallerAbstract template method for unmarshalling from a givenInputStream.- Specified by:
unmarshalInputStreamin classAbstractMarshaller- Parameters:
inputStream- theInputStreamStreamto 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:AbstractMarshallerAbstract template method for unmarshalling from a givenReader.- Specified by:
unmarshalReaderin classAbstractMarshaller- Parameters:
reader- theReaderto 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 givenXMLExceptionto an appropriate exception from theorg.springframework.oxmhierarchy.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- CastorXMLExceptionthat occurredmarshalling- indicates whether the exception occurs during marshalling (true), or unmarshalling (false)- Returns:
- the corresponding
XmlMappingException