Package com.thoughtworks.xstream.io.xml

Examples of com.thoughtworks.xstream.io.xml.DomWriter


  @Override
  protected void marshalDomNode(Object graph, Node node) throws XmlMappingException {
    HierarchicalStreamWriter streamWriter;
    if (node instanceof Document) {
      streamWriter = new DomWriter((Document) node);
    }
    else if (node instanceof Element) {
      streamWriter = new DomWriter((Element) node, node.getOwnerDocument(), new XmlFriendlyReplacer());
    }
    else {
      throw new IllegalArgumentException("DOMResult contains neither Document nor Element");
    }
    marshal(graph, streamWriter);
View Full Code Here


            documentBuilder = documentBuilderFactory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new ConversionException("Cannot instantiate " + Document.class.getName(), e);
        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        copy(reader, writer);

        if (Document.class.isAssignableFrom(unmarshallingContext.getRequiredType())) {
            return document;
View Full Code Here

            documentBuilder = documentBuilderFactory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw (IOException)new IOException("Cannot instantiate " + Document.class.getName()).initCause(e);
        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        XStream xstream = XStreamUtil.createXStream();
        xstream.marshal(gbeanDatas, writer);

//        FileWriter w = new FileWriter("target/foo.xml");
View Full Code Here

            documentBuilder = documentBuilderFactory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new ConversionException("Cannot instantiate " + Document.class.getName(), e);
        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        copy(reader, writer);

        if (Document.class.isAssignableFrom(unmarshallingContext.getRequiredType())) {
            return document;
View Full Code Here

            documentBuilder = documentBuilderFactory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw (IOException)new IOException("Cannot instantiate " + Document.class.getName()).initCause(e);
        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        XStream xstream = XStreamUtil.createXStream();
        xstream.marshal(gbeanDatas, writer);

//        FileWriter w = new FileWriter("target/foo.xml");
View Full Code Here

            documentBuilder = documentBuilderFactory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new ConversionException("Cannot instantiate " + Document.class.getName(), e);
        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        copy(reader, writer);

        if (Document.class.isAssignableFrom(unmarshallingContext.getRequiredType())) {
            return document;
View Full Code Here

            documentBuilder = documentBuilderFactory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw (IOException)new IOException("Cannot instantiate " + Document.class.getName()).initCause(e);
        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        XStream xstream = XStreamUtil.createXStream();
        xstream.marshal(gbeanDatas, writer);

//        FileWriter w = new FileWriter("target/foo.xml");
View Full Code Here

       
        //
        // use marshal rather than toXML so we can serialize the object
        // directly to DOM (toXML returns a string of XML)
        //
        getXStream().marshal(result, new DomWriter(doc));
       
        //
        // XStream creates DOM Level 1 - argh! we need qualified names
        // to be schema-compliant, so we have to copy the whole DOM tree
        // in a Level 2 way. DOM (both levels) does not permit the
View Full Code Here

            documentBuilder = documentBuilderFactory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new ConversionException("Cannot instantiate " + Document.class.getName(), e);
        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        copy(reader, writer);

        if (Document.class.isAssignableFrom(unmarshallingContext.getRequiredType())) {
            return document;
View Full Code Here

            documentBuilder = documentBuilderFactory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw (IOException)new IOException("Cannot instantiate " + Document.class.getName()).initCause(e);
        }
        Document document = documentBuilder.newDocument();
        DomWriter writer = new DomWriter(document);

        XStream xstream = XStreamUtil.createXStream();
        xstream.marshal(gbeanDatas, writer);

//        FileWriter w = new FileWriter("target/foo.xml");
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.xml.DomWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.