Java Doc for AbstractMarshaller.java in  » Web-Services » spring-ws-1.0.0 » org » springframework » oxm » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Services » spring ws 1.0.0 » org.springframework.oxm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.oxm.AbstractMarshaller

All known Subclasses:   org.springframework.oxm.jibx.JibxMarshaller,  org.springframework.oxm.xmlbeans.XmlBeansMarshaller,  org.springframework.oxm.castor.CastorMarshaller,  org.springframework.oxm.xstream.XStreamMarshaller,
AbstractMarshaller
abstract public class AbstractMarshaller implements Marshaller,Unmarshaller(Code)
Abstract implementation of the Marshaller and Unmarshaller interface. This implementation inspects the given Source or Result, and defers further handling to overridable template methods.
author:
   Arjen Poutsma
since:
   1.0.0


Field Summary
final protected  Loglogger
     Logger available to subclasses.


Method Summary
protected  DocumentBuildercreateDocumentBuilder(DocumentBuilderFactory factory)
     Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource.
protected  DocumentBuilderFactorycreateDocumentBuilderFactory()
     Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource.
protected  XMLReadercreateXmlReader()
     Create a XMLReader that this marshaller will when passed an empty SAXSource.
final public  voidmarshal(Object graph, Result result)
     Marshals the object graph with the given root into the provided javax.xml.transform.Result.
abstract protected  voidmarshalDomNode(Object graph, Node node)
     Abstract template method for marshalling the given object graph to a DOM Node.

In practice, node is be a Document node, a DocumentFragment node, or a Element node.

protected  voidmarshalDomResult(Object graph, DOMResult domResult)
     Template method for handling DOMResults.
abstract protected  voidmarshalOutputStream(Object graph, OutputStream outputStream)
     Abstract template method for marshalling the given object graph to a OutputStream.
abstract protected  voidmarshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
     Abstract template method for marshalling the given object graph to a SAX ContentHandler.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  contentHandler - the SAX ContentHandler
Parameters:
  lexicalHandler - the SAX2 LexicalHandler.
protected  voidmarshalSaxResult(Object graph, SAXResult saxResult)
     Template method for handling SAXResults.
protected  voidmarshalStaxResult(Object graph, StaxResult staxResult)
     Template method for handling StaxResults.
protected  voidmarshalStreamResult(Object graph, StreamResult streamResult)
     Template method for handling StreamResults.
abstract protected  voidmarshalWriter(Object graph, Writer writer)
     Abstract template method for marshalling the given object graph to a Writer.
abstract protected  voidmarshalXmlEventWriter(Object graph, XMLEventWriter eventWriter)
     Abstract template method for marshalling the given object to a StAX XMLEventWriter.
abstract protected  voidmarshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter)
     Abstract template method for marshalling the given object to a StAX XMLStreamWriter.
final public  Objectunmarshal(Source source)
     Unmarshals the given provided javax.xml.transform.Source into an object graph.
abstract protected  ObjectunmarshalDomNode(Node node)
     Abstract template method for unmarshalling from a given DOM Node.
protected  ObjectunmarshalDomSource(DOMSource domSource)
     Template method for handling DOMSources.
abstract protected  ObjectunmarshalInputStream(InputStream inputStream)
     Abstract template method for unmarshalling from a given InputStream.
abstract protected  ObjectunmarshalReader(Reader reader)
     Abstract template method for unmarshalling from a given Reader.
abstract protected  ObjectunmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
     Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.
protected  ObjectunmarshalSaxSource(SAXSource saxSource)
     Template method for handling SAXSources.
protected  ObjectunmarshalStaxSource(StaxSource staxSource)
     Template method for handling StaxSources.
protected  ObjectunmarshalStreamSource(StreamSource streamSource)
     Template method for handling StreamSources.
abstract protected  ObjectunmarshalXmlEventReader(XMLEventReader eventReader)
     Abstract template method for unmarshalling from a given Stax XMLEventReader.
abstract protected  ObjectunmarshalXmlStreamReader(XMLStreamReader streamReader)
     Abstract template method for unmarshalling from a given Stax XMLStreamReader.

Field Detail
logger
final protected Log logger(Code)
Logger available to subclasses.





Method Detail
createDocumentBuilder
protected DocumentBuilder createDocumentBuilder(DocumentBuilderFactory factory) throws ParserConfigurationException(Code)
Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource. Can be overridden in subclasses, adding further initialization of the builder.
Parameters:
  factory - the DocumentBuilderFactory that the DocumentBuilder should be created with the DocumentBuilder
throws:
  javax.xml.parsers.ParserConfigurationException - if thrown by JAXP methods



createDocumentBuilderFactory
protected DocumentBuilderFactory createDocumentBuilderFactory() throws ParserConfigurationException(Code)
Create a DocumentBuilder that this marshaller will use for creating DOM documents when passed an empty DOMSource. The resulting DocumentBuilderFactory is cached, so this method will only be called once. the DocumentBuilderFactory
throws:
  ParserConfigurationException - if thrown by JAXP methods



createXmlReader
protected XMLReader createXmlReader() throws SAXException(Code)
Create a XMLReader that this marshaller will when passed an empty SAXSource. the XMLReader
throws:
  SAXException - if thrown by JAXP methods



marshal
final public void marshal(Object graph, Result result) throws XmlMappingException, IOException(Code)
Marshals the object graph with the given root into the provided javax.xml.transform.Result.

This implementation inspects the given result, and calls marshalDomResult, marshalSaxResult, or marshalStreamResult.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  result - the result to marshal to
throws:
  XmlMappingException - if the given object cannot be marshalled to the result
throws:
  IOException - if an I/O exception occurs
throws:
  IllegalArgumentException - if result if neither a DOMResult,SAXResult, StreamResult
See Also:   AbstractMarshaller.marshalDomResult(Object,javax.xml.transform.dom.DOMResult)
See Also:   AbstractMarshaller.marshalSaxResult(Object,javax.xml.transform.sax.SAXResult)
See Also:   AbstractMarshaller.marshalStreamResult(Object,javax.xml.transform.stream.StreamResult)




marshalDomNode
abstract protected void marshalDomNode(Object graph, Node node) throws XmlMappingException(Code)
Abstract template method for marshalling the given object graph to a DOM Node.

In practice, node is be a Document node, a DocumentFragment node, or a Element node. In other words, a node that accepts children.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  node - The DOM node that will contain the result tree
throws:
  XmlMappingException - if the given object cannot be marshalled to the DOM node
See Also:   org.w3c.dom.Document
See Also:   org.w3c.dom.DocumentFragment
See Also:   org.w3c.dom.Element




marshalDomResult
protected void marshalDomResult(Object graph, DOMResult domResult) throws XmlMappingException(Code)
Template method for handling DOMResults. This implementation defers to marshalDomNode.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  domResult - the DOMResult
throws:
  XmlMappingException - if the given object cannot be marshalled to the result
throws:
  IllegalArgumentException - if the domResult is empty
See Also:   AbstractMarshaller.marshalDomNode(Object,org.w3c.dom.Node)



marshalOutputStream
abstract protected void marshalOutputStream(Object graph, OutputStream outputStream) throws XmlMappingException, IOException(Code)
Abstract template method for marshalling the given object graph to a OutputStream.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  outputStream - the OutputStream to write to
throws:
  XmlMappingException - if the given object cannot be marshalled to the writer
throws:
  IOException - if an I/O exception occurs



marshalSaxHandlers
abstract protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler) throws XmlMappingException(Code)
Abstract template method for marshalling the given object graph to a SAX ContentHandler.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  contentHandler - the SAX ContentHandler
Parameters:
  lexicalHandler - the SAX2 LexicalHandler. Can be null.
throws:
  XmlMappingException - if the given object cannot be marshalled to the handlers



marshalSaxResult
protected void marshalSaxResult(Object graph, SAXResult saxResult) throws XmlMappingException(Code)
Template method for handling SAXResults. This implementation defers to marshalSaxHandlers.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  saxResult - the SAXResult
throws:
  XmlMappingException - if the given object cannot be marshalled to the result
See Also:   AbstractMarshaller.marshalSaxHandlers(Object,org.xml.sax.ContentHandler,org.xml.sax.ext.LexicalHandler)



marshalStaxResult
protected void marshalStaxResult(Object graph, StaxResult staxResult) throws XmlMappingException(Code)
Template method for handling StaxResults. This implementation defers to marshalXMLSteamWriter, or marshalXMLEventConsumer, depending on what is contained in the StaxResult.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  staxResult - the StaxResult
throws:
  XmlMappingException - if the given object cannot be marshalled to the result
throws:
  IllegalArgumentException - if the domResult is empty
See Also:   AbstractMarshaller.marshalDomNode(Object,org.w3c.dom.Node)



marshalStreamResult
protected void marshalStreamResult(Object graph, StreamResult streamResult) throws XmlMappingException, IOException(Code)
Template method for handling StreamResults. This implementation defers to marshalOutputStream, or marshalWriter, depending on what is contained in the StreamResult
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  streamResult - the StreamResult
throws:
  IOException - if an I/O Exception occurs
throws:
  XmlMappingException - if the given object cannot be marshalled to the result
throws:
  IllegalArgumentException - if streamResult contains neither OutputStream norWriter.



marshalWriter
abstract protected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException(Code)
Abstract template method for marshalling the given object graph to a Writer.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  writer - the Writer to write to
throws:
  XmlMappingException - if the given object cannot be marshalled to the writer
throws:
  IOException - if an I/O exception occurs



marshalXmlEventWriter
abstract protected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) throws XmlMappingException(Code)
Abstract template method for marshalling the given object to a StAX XMLEventWriter.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  eventWriter - the XMLEventWriter to write to
throws:
  XmlMappingException - if the given object cannot be marshalled to the DOM node



marshalXmlStreamWriter
abstract protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException(Code)
Abstract template method for marshalling the given object to a StAX XMLStreamWriter.
Parameters:
  graph - the root of the object graph to marshal
Parameters:
  streamWriter - the XMLStreamWriter to write to
throws:
  XmlMappingException - if the given object cannot be marshalled to the DOM node



unmarshal
final public Object unmarshal(Source source) throws XmlMappingException, IOException(Code)
Unmarshals the given provided javax.xml.transform.Source into an object graph.

This implementation inspects the given result, and calls unmarshalDomSource, unmarshalSaxSource, or unmarshalStreamSource.
Parameters:
  source - the source to marshal from the object graph
throws:
  XmlMappingException - if the given source cannot be mapped to an object
throws:
  IOException - if an I/O Exception occurs
throws:
  IllegalArgumentException - if source is neither a DOMSource, aSAXSource, nor a StreamSource
See Also:   AbstractMarshaller.unmarshalDomSource(javax.xml.transform.dom.DOMSource)
See Also:   AbstractMarshaller.unmarshalSaxSource(javax.xml.transform.sax.SAXSource)
See Also:   AbstractMarshaller.unmarshalStreamSource(javax.xml.transform.stream.StreamSource)




unmarshalDomNode
abstract protected Object unmarshalDomNode(Node node) throws XmlMappingException(Code)
Abstract template method for unmarshalling from a given DOM Node.
Parameters:
  node - The DOM node that contains the objects to be unmarshalled the object graph
throws:
  XmlMappingException - if the given DOM node cannot be mapped to an object



unmarshalDomSource
protected Object unmarshalDomSource(DOMSource domSource) throws XmlMappingException(Code)
Template method for handling DOMSources. This implementation defers to unmarshalDomNode. If the given source is empty, an empty source Document will be created as a placeholder.
Parameters:
  domSource - the DOMSource the object graph
throws:
  IllegalArgumentException - if the domSource is empty
throws:
  XmlMappingException - if the given source cannot be mapped to an object
See Also:   AbstractMarshaller.unmarshalDomNode(org.w3c.dom.Node)



unmarshalInputStream
abstract protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException(Code)
Abstract template method for unmarshalling from a given InputStream.
Parameters:
  inputStream - the InputStreamStream to read from the object graph
throws:
  XmlMappingException - if the given stream cannot be converted to an object
throws:
  IOException - if an I/O exception occurs



unmarshalReader
abstract protected Object unmarshalReader(Reader reader) throws XmlMappingException, IOException(Code)
Abstract template method for unmarshalling from a given Reader.
Parameters:
  reader - the Reader to read from the object graph
throws:
  XmlMappingException - if the given reader cannot be converted to an object
throws:
  IOException - if an I/O exception occurs



unmarshalSaxReader
abstract protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) throws XmlMappingException, IOException(Code)
Abstract template method for unmarshalling using a given SAX XMLReader and InputSource.
Parameters:
  xmlReader - the SAX XMLReader to parse with
Parameters:
  inputSource - the input source to parse from the object graph
throws:
  XmlMappingException - if the given reader and input source cannot be converted to an object



unmarshalSaxSource
protected Object unmarshalSaxSource(SAXSource saxSource) throws XmlMappingException, IOException(Code)
Template method for handling SAXSources. This implementation defers to unmarshalSaxReader.
Parameters:
  saxSource - the SAXSource the object graph
throws:
  XmlMappingException - if the given source cannot be mapped to an object
throws:
  IOException - if an I/O Exception occurs
See Also:   AbstractMarshaller.unmarshalSaxReader(org.xml.sax.XMLReader,org.xml.sax.InputSource)



unmarshalStaxSource
protected Object unmarshalStaxSource(StaxSource staxSource) throws XmlMappingException(Code)
Template method for handling StaxSources. This implementation defers to unmarshalXmlStreamReader, or unmarshalXmlEventReader.
Parameters:
  staxSource - the StaxSource the object graph
throws:
  XmlMappingException - if the given source cannot be mapped to an object



unmarshalStreamSource
protected Object unmarshalStreamSource(StreamSource streamSource) throws XmlMappingException, IOException(Code)
Template method for handling StreamSources. This implementation defers to unmarshalInputStream, or unmarshalReader.
Parameters:
  streamSource - the StreamSource the object graph
throws:
  IOException - if an I/O exception occurs
throws:
  XmlMappingException - if the given source cannot be mapped to an object



unmarshalXmlEventReader
abstract protected Object unmarshalXmlEventReader(XMLEventReader eventReader) throws XmlMappingException(Code)
Abstract template method for unmarshalling from a given Stax XMLEventReader.
Parameters:
  eventReader - The XMLEventReader to read from the object graph
throws:
  XmlMappingException - if the given event reader cannot be converted to an object



unmarshalXmlStreamReader
abstract protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException(Code)
Abstract template method for unmarshalling from a given Stax XMLStreamReader.
Parameters:
  streamReader - The XMLStreamReader to read from the object graph
throws:
  XmlMappingException - if the given stream reader cannot be converted to an object



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.