Examples of TreeMarshaller


Examples of com.thoughtworks.xstream.core.TreeMarshaller

            Software.class, mapper, reflectionProvider, converterLookup, "name"), 0);

        final Software name = new Software(null, "XStream");
        final StringWriter writer = new StringWriter();
        final CompactWriter compactWriter = new CompactWriter(writer);
        new TreeMarshaller(compactWriter, converterLookup, mapper).start(name, null);
        compactWriter.flush();
        assertEquals("<software>XStream</software>", writer.toString());

        final HierarchicalStreamReader reader = new XppReader(new StringReader(
            writer.toString()));
View Full Code Here

Examples of com.thoughtworks.xstream.core.TreeMarshaller

            Software.class), 0);

        final Software software = new OpenSourceSoftware("Codehaus", "XStream", "BSD");
        final StringWriter writer = new StringWriter();
        final CompactWriter compactWriter = new CompactWriter(writer);
        new TreeMarshaller(compactWriter, converterLookup, mapper).start(software, null);
        compactWriter.flush();
        assertEquals(
            "<open-source vendor=\"Codehaus\" license=\"BSD\">XStream</open-source>",
            writer.toString());
View Full Code Here

Examples of com.thoughtworks.xstream.core.TreeMarshaller

        final Software[] software = new Software[]{
            new Software("Microsoft", "Windows"),
            new OpenSourceSoftware("Codehaus", "XStream", "BSD")};
        final StringWriter writer = new StringWriter();
        final PrettyPrintWriter prettyPrintWriter = new PrettyPrintWriter(writer);
        new TreeMarshaller(prettyPrintWriter, converterLookup, mapper).start(software, null);
        prettyPrintWriter.flush();
        assertEquals(""
            + "<software-array>\n"
            + "  <software vendor=\"Microsoft\">Windows</software>\n"
            + "  <open-source vendor=\"Codehaus\" name=\"XStream\">BSD</open-source>\n"
View Full Code Here

Examples of com.thoughtworks.xstream.core.TreeMarshaller

            Software.class, mapper, reflectionProvider, converterLookup, "name"), 0);

        final Software software = new Software(null, null);
        final StringWriter writer = new StringWriter();
        final CompactWriter compactWriter = new CompactWriter(writer);
        new TreeMarshaller(compactWriter, converterLookup, mapper).start(software, null);
        compactWriter.flush();
        assertEquals("<software/>", writer.toString());

        final HierarchicalStreamReader reader = new XppReader(new StringReader(
            writer.toString()));
View Full Code Here

Examples of com.thoughtworks.xstream.core.TreeMarshaller

            Software.class, mapper, reflectionProvider, converterLookup, null), 0);

        final Software software = new Software("Codehaus", "XStream");
        final StringWriter writer = new StringWriter();
        final CompactWriter compactWriter = new CompactWriter(writer);
        new TreeMarshaller(compactWriter, converterLookup, mapper).start(software, null);
        compactWriter.flush();
        assertEquals("<software vendor=\"Codehaus\" name=\"XStream\"/>", writer.toString());

        final HierarchicalStreamReader reader = new XppReader(new StringReader(
            writer.toString()));
View Full Code Here

Examples of com.thoughtworks.xstream.core.TreeMarshaller

        x.aStr = "xXx";
        x.innerObj = new Y();
        x.innerObj.yField = "inner";
        final StringWriter writer = new StringWriter();
        final CompactWriter compactWriter = new CompactWriter(writer);
        new TreeMarshaller(compactWriter, converterLookup, mapper).start(x, null);
        compactWriter.flush();
        assertEquals(
            "<x aStr=\"xXx\" anInt=\"42\"><yField>inner</yField></x>", writer.toString());

        final HierarchicalStreamReader reader = new XppReader(new StringReader(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.