Search in sources :

Example 1 with DomWriter

use of com.thoughtworks.xstream.io.xml.DomWriter in project spring-framework by spring-projects.

the class XStreamMarshaller method marshalDomNode.

// Marshalling
@Override
protected void marshalDomNode(Object graph, Node node) throws XmlMappingException {
    HierarchicalStreamWriter streamWriter;
    if (node instanceof Document) {
        streamWriter = new DomWriter((Document) node, this.nameCoder);
    } else if (node instanceof Element) {
        streamWriter = new DomWriter((Element) node, node.getOwnerDocument(), this.nameCoder);
    } else {
        throw new IllegalArgumentException("DOMResult contains neither Document nor Element");
    }
    doMarshal(graph, streamWriter, null);
}
Also used : DomWriter(com.thoughtworks.xstream.io.xml.DomWriter) HierarchicalStreamWriter(com.thoughtworks.xstream.io.HierarchicalStreamWriter) Element(org.w3c.dom.Element) Document(org.w3c.dom.Document)

Aggregations

HierarchicalStreamWriter (com.thoughtworks.xstream.io.HierarchicalStreamWriter)1 DomWriter (com.thoughtworks.xstream.io.xml.DomWriter)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1