| java.lang.Object org.springframework.oxm.AbstractMarshaller org.springframework.oxm.castor.CastorMarshaller
Method Summary | |
final public void | afterPropertiesSet() | public XmlMappingException | convertCastorException(XMLException ex, boolean marshalling) Converts the given CastorException to an appropriate exception from the
org.springframework.oxm hierarchy.
The default implementation delegates to CastorUtils . | protected XMLClassDescriptorResolver | createClassDescriptorResolver(Resource[] mappingLocations, Class targetClass) Creates the Castor XMLClassDescriptorResolver . | protected void | customizeMarshaller(Marshaller marshaller) Template method that allows for customizing of the given Castor
Marshaller . | protected void | customizeUnmarshaller(Unmarshaller unmarshaller) Template method that allows for customizing of the given Castor
Unmarshaller . | public boolean | getIgnoreExtraAttributes() Returns whether the Castor
Unmarshaller should ignore attributes that do not match a specific field. | public boolean | getIgnoreExtraElements() Returns whether the Castor
Unmarshaller should ignore elements that do not match a specific field. | public boolean | getWhitespacePreserve() Returns whether the Castor
Unmarshaller should preserve "ignorable" whitespace. | public boolean | isValidating() Returns whether this marshaller should validate in- and outgoing documents. | final protected void | marshalDomNode(Object graph, Node node) | final protected void | marshalOutputStream(Object graph, OutputStream outputStream) | final protected void | marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) | final protected void | marshalWriter(Object graph, Writer writer) | final protected void | marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) | final protected void | marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) | public void | setEncoding(String encoding) Sets the encoding to be used for stream access. | public void | setIgnoreExtraAttributes(boolean ignoreExtraAttributes) Sets whether the Castor
Unmarshaller should ignore attributes that do not match a specific field. | public void | setIgnoreExtraElements(boolean ignoreExtraElements) Sets whether the Castor
Unmarshaller should ignore elements that do not match a specific field. | public void | setMappingLocation(Resource mappingLocation) Sets the locations of the Castor XML Mapping files. | public void | setMappingLocations(Resource[] mappingLocations) Sets the locations of the Castor XML Mapping files. | public void | setTargetClass(Class targetClass) Sets the Castor target class. | public void | setValidating(boolean validating) Sets whether this marshaller should validate in- and outgoing documents. | public void | setWhitespacePreserve(boolean whitespacePreserve) Sets whether the Castor
Unmarshaller should preserve "ignorable" whitespace. | public boolean | supports(Class clazz) Returns true for all classes, i.e. | final protected Object | unmarshalDomNode(Node node) | final protected Object | unmarshalInputStream(InputStream inputStream) | final protected Object | unmarshalReader(Reader reader) | final protected Object | unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) | final protected Object | unmarshalXmlEventReader(XMLEventReader eventReader) | final protected Object | unmarshalXmlStreamReader(XMLStreamReader streamReader) |
DEFAULT_ENCODING | final public static String DEFAULT_ENCODING(Code) | | The default encoding used for stream access.
|
convertCastorException | public XmlMappingException convertCastorException(XMLException ex, boolean marshalling)(Code) | | Converts the given CastorException to an appropriate exception from the
org.springframework.oxm hierarchy.
The default implementation delegates to CastorUtils . Can be overridden in subclasses.
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 - Castor XMLException that occured Parameters: marshalling - indicates whether the exception occurs during marshalling (true ), orunmarshalling (false ) the corresponding XmlMappingException See Also: CastorUtils.convertXmlException |
createClassDescriptorResolver | protected XMLClassDescriptorResolver createClassDescriptorResolver(Resource[] mappingLocations, Class targetClass) throws MappingException, IOException(Code) | | Creates the Castor XMLClassDescriptorResolver . Subclasses can override this to create a custom
resolver.
The default implementation loads mapping files if defined, or loads the target class if not defined.
the created resolver throws: MappingException - when the mapping file cannot be loaded throws: IOException - in case of I/O errors |
customizeMarshaller | protected void customizeMarshaller(Marshaller marshaller)(Code) | | Template method that allows for customizing of the given Castor
Marshaller .
Default implementation invokes
Marshaller.setValidation(boolean) with the property set on this
marshaller.
|
customizeUnmarshaller | protected void customizeUnmarshaller(Unmarshaller unmarshaller)(Code) | | Template method that allows for customizing of the given Castor
Unmarshaller .
Default implementation invokes
Unmarshaller.setValidation(boolean) ,
Unmarshaller.setWhitespacePreserve(boolean) ,
Unmarshaller.setIgnoreExtraAttributes(boolean) , and
Unmarshaller.setIgnoreExtraElements(boolean) with the properties set on this marshaller.
|
getIgnoreExtraAttributes | public boolean getIgnoreExtraAttributes()(Code) | | Returns whether the Castor
Unmarshaller should ignore attributes that do not match a specific field.
|
getIgnoreExtraElements | public boolean getIgnoreExtraElements()(Code) | | Returns whether the Castor
Unmarshaller should ignore elements that do not match a specific field.
|
getWhitespacePreserve | public boolean getWhitespacePreserve()(Code) | | Returns whether the Castor
Unmarshaller should preserve "ignorable" whitespace.
|
isValidating | public boolean isValidating()(Code) | | Returns whether this marshaller should validate in- and outgoing documents.
|
setIgnoreExtraAttributes | public void setIgnoreExtraAttributes(boolean ignoreExtraAttributes)(Code) | | Sets whether the Castor
Unmarshaller should ignore attributes that do not match a specific field.
Default is true : extra attributes are ignored.
|
setIgnoreExtraElements | public void setIgnoreExtraElements(boolean ignoreExtraElements)(Code) | | Sets whether the Castor
Unmarshaller should ignore elements that do not match a specific field. Default
is false , extra attributes are flagged as an error.
|
setMappingLocation | public void setMappingLocation(Resource mappingLocation)(Code) | | Sets the locations of the Castor XML Mapping files.
|
setMappingLocations | public void setMappingLocations(Resource[] mappingLocations)(Code) | | Sets the locations of the Castor XML Mapping files.
|
setTargetClass | public void setTargetClass(Class targetClass)(Code) | | Sets the Castor target class. If this property is set, this CastorMarshaller is tied to this one
specific class. Use a mapping file for unmarshalling multiple classes.
You cannot set both this property and the mapping (location).
|
setValidating | public void setValidating(boolean validating)(Code) | | Sets whether this marshaller should validate in- and outgoing documents. Default is false .
|
setWhitespacePreserve | public void setWhitespacePreserve(boolean whitespacePreserve)(Code) | | Sets whether the Castor
Unmarshaller should preserve "ignorable" whitespace. Default is
false .
|
supports | public boolean supports(Class clazz)(Code) | | Returns true for all classes, i.e. Castor supports arbitrary classes.
|
Fields inherited from org.springframework.oxm.AbstractMarshaller | final protected Log logger(Code)(Java Doc)
|
Methods inherited from org.springframework.oxm.AbstractMarshaller | protected DocumentBuilder createDocumentBuilder(DocumentBuilderFactory factory) throws ParserConfigurationException(Code)(Java Doc) protected DocumentBuilderFactory createDocumentBuilderFactory() throws ParserConfigurationException(Code)(Java Doc) protected XMLReader createXmlReader() throws SAXException(Code)(Java Doc) final public void marshal(Object graph, Result result) throws XmlMappingException, IOException(Code)(Java Doc) abstract protected void marshalDomNode(Object graph, Node node) throws XmlMappingException(Code)(Java Doc) protected void marshalDomResult(Object graph, DOMResult domResult) throws XmlMappingException(Code)(Java Doc) abstract protected void marshalOutputStream(Object graph, OutputStream outputStream) throws XmlMappingException, IOException(Code)(Java Doc) abstract protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) throws XmlMappingException(Code)(Java Doc) protected void marshalSaxResult(Object graph, SAXResult saxResult) throws XmlMappingException(Code)(Java Doc) protected void marshalStaxResult(Object graph, StaxResult staxResult) throws XmlMappingException(Code)(Java Doc) protected void marshalStreamResult(Object graph, StreamResult streamResult) throws XmlMappingException, IOException(Code)(Java Doc) abstract protected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException(Code)(Java Doc) abstract protected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) throws XmlMappingException(Code)(Java Doc) abstract protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException(Code)(Java Doc) final public Object unmarshal(Source source) throws XmlMappingException, IOException(Code)(Java Doc) abstract protected Object unmarshalDomNode(Node node) throws XmlMappingException(Code)(Java Doc) protected Object unmarshalDomSource(DOMSource domSource) throws XmlMappingException(Code)(Java Doc) abstract protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException(Code)(Java Doc) abstract protected Object unmarshalReader(Reader reader) throws XmlMappingException, IOException(Code)(Java Doc) abstract protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) throws XmlMappingException, IOException(Code)(Java Doc) protected Object unmarshalSaxSource(SAXSource saxSource) throws XmlMappingException, IOException(Code)(Java Doc) protected Object unmarshalStaxSource(StaxSource staxSource) throws XmlMappingException(Code)(Java Doc) protected Object unmarshalStreamSource(StreamSource streamSource) throws XmlMappingException, IOException(Code)(Java Doc) abstract protected Object unmarshalXmlEventReader(XMLEventReader eventReader) throws XmlMappingException(Code)(Java Doc) abstract protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException(Code)(Java Doc)
|
|
|