XML Marshaller by R4R Team

Marshaller and Unmarshaller XML:-

XML Marshaller:A marshaller serializes an object to XML.Here we will describe the Spring interfaces used for this purpose.
Spring abstracts all marshalling operations behind the org.springframework.oxm.Marshaller interface, the main methods of this as shows below.

public interface Marshaller {

/**

* Marshals the object graph with the given root into the provided Result.

*/

void marshal(Object graph, Result result) throws XmlMappingException, IOException;

}

The Marshaller interface has one main method, which marshals the given object to a given javax.xml.transform.Result. Result is a tagging interface that basically represents an XML output abstraction: concrete implementations wrap various XML representations, as described below:

Result implementation

 Wraps XML representation

DOMResult

org.w3c.dom.Node

SAXResult

org.xml.sax.ContentHandler

StreamResult

java.io.File, java.io.OutputStream, or java.io.Writer

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!