Package org.codehaus.jettison

Examples of org.codehaus.jettison.AbstractXMLStreamWriter.writeEndDocument()


              w.writeStartElement("goof");
              w.writeEndElement();
            w.writeEndElement();
        w.writeEndElement();
        w.writeEndElement();
        w.writeEndDocument();

        w.close();
        strWriter.close();

        assertEquals("{\"Foo\":{\"bazs\":[{\"quacks\":[{\"goof\":\"\"}]}]}}", strWriter.toString());
View Full Code Here


        addChild(w);
        addChild(w);
        addChild(w);
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":[" +
View Full Code Here

       
        w.writeStartElement("other");
        w.writeCharacters("test");
        w.writeEndElement();
       
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":{\"child\":[\"first\",\"second\",\"third\"]},\"other\":\"test\"}", strWriter.toString());
View Full Code Here

        addChild(w);
        addChild(w);
        addChild(w);
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":{\"child\":[" +
View Full Code Here

       
        w.writeStartElement("http://foo/", "child");
        w.writeEndElement();
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"foo.root\":{\"foo.child\":[\"\",\"\"]}}", strWriter.toString());
View Full Code Here

        w.writeStartElement("", "n", "");
        w.writeCharacters("5");
        w.writeEndElement();
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();

        assertEquals("{\"a\":{\"vals\":{\"string\":[1,2,3]},\"n\":5}}", strWriter.toString());
View Full Code Here

            w.writeCharacters("Belgrade");
          w.writeEndElement();
        w.writeEndElement();
        w.writeEndElement();
       
        w.writeEndDocument();
        w.close();
        strWriter.close();
        String result = strWriter.toString();
        assertEquals(result, "{\"map\":{\"entry\":[{\"string\":[\"id\",6]},{\"string\":[\"name\",\"Dejan\"]},{\"string\":[\"city\",\"Belgrade\"]}]}}");
    }
View Full Code Here

                            w.writeEndElement();
                        w.writeEndElement();
                    w.writeEndElement();
                w.writeEndElement();
            w.writeEndElement();
        w.writeEndDocument();

        w.close();
        strWriter.close();

        assertEquals("{\"definition\":" +
View Full Code Here

        AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
       
        w.writeStartDocument();
        w.writeStartElement("root");
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
      
        assertEquals("{\"root\":\"\"}", strWriter.toString());
View Full Code Here

        w.writeStartDocument();
        w.writeStartElement("root");
        w.writeStartElement("child");
        w.writeEndElement();
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":{\"child\":\"\"}}", strWriter.toString());
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.