Package com.thoughtworks.xstream.io.copy

Examples of com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier


        } else if (formatExtension.equalsIgnoreCase("json")) {
            HierarchicalStreamDriver driver = new JettisonMappedXmlDriver();
            HierarchicalStreamReader hsr = driver.createReader(is);
            // See http://jira.codehaus.org/browse/JETTISON-48
            StringWriter writer = new StringWriter();
            new HierarchicalStreamCopier().copy(
                    hsr, new PrettyPrintWriter(writer));
            writer.close();
            newLayer = (WMSLayer) xs.fromXML(writer.toString());
        } else {
            throw new RestletException("Unknown or missing format extension: "
View Full Code Here


    private String convertJson(String entityText) throws IOException {
        HierarchicalStreamDriver driver = new JettisonMappedXmlDriver();
        StringReader reader = new StringReader(entityText);
        HierarchicalStreamReader hsr = driver.createReader(reader);
        StringWriter writer = new StringWriter();
        new HierarchicalStreamCopier().copy(hsr, new PrettyPrintWriter(
                writer));
        writer.close();
        return writer.toString();
    }
View Full Code Here

        xppA.addChild(xppB);
        xppB.setAttribute("attr", "foo");
       
        assertDocumentProducedIs(xppA, xppB);
        XppDomWriter xppDomWriter = new XppDomWriter();
        new HierarchicalStreamCopier().copy(createDocumentReaderFor(document.getDocumentElement()), xppDomWriter);
        assertTrue(equals(xppRoot, xppDomWriter.getConfiguration()));
    }
View Full Code Here

        xppA.addChild(xppB);
        xppB.setAttribute("attr", "foo");
       
        assertDocumentProducedIs(xppA, xppB);
        XppDomWriter xppDomWriter = new XppDomWriter();
        new HierarchicalStreamCopier().copy(createDocumentReaderFor(document.getDocumentElement()), xppDomWriter);
        assertTrue(equals(xppRoot, xppDomWriter.getConfiguration()));
    }
View Full Code Here

            } else if (formatExtension.equalsIgnoreCase("json")) {
                HierarchicalStreamDriver driver = new JettisonMappedXmlDriver();
                HierarchicalStreamReader hsr = driver.createReader(is);
                // See http://jira.codehaus.org/browse/JETTISON-48
                StringWriter writer = new StringWriter();
                new HierarchicalStreamCopier().copy(hsr, new PrettyPrintWriter(writer));
                writer.close();
                newLayer = (TileLayer) xs.fromXML(writer.toString());
            } else {
                throw new RestletException("Unknown or missing format extension: "
                        + formatExtension, Status.CLIENT_ERROR_BAD_REQUEST);
View Full Code Here

    private String convertJson(String entityText) throws IOException {
        HierarchicalStreamDriver driver = new JettisonMappedXmlDriver();
        StringReader reader = new StringReader(entityText);
        HierarchicalStreamReader hsr = driver.createReader(reader);
        StringWriter writer = new StringWriter();
        new HierarchicalStreamCopier().copy(hsr, new PrettyPrintWriter(writer));
        writer.close();
        return writer.toString();
    }
View Full Code Here

    HierarchicalStreamDriver driver = new JettisonMappedXmlDriver();
    StringReader reader = new StringReader(json);
    HierarchicalStreamReader hsr = driver.createReader(reader);
    StringWriter writer = new StringWriter();
    try {
      new HierarchicalStreamCopier().copy(hsr, new PrettyPrintWriter(
          writer));
      return writer.toString();
    } finally {
      if (writer != null) {
        try {
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier

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.