Package org.codehaus.jettison

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


        w.writeCharacters(Long.MIN_VALUE + "");
        w.writeEndElement();


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

        w.close();
        strWriter.close();
        String expected = "{\"root\":{\"subchild1\":[" + Long.MAX_VALUE + "," + Long.MIN_VALUE + "]}}";
        String actual = strWriter.toString();
View Full Code Here


        w.writeStartElement("subchild1");
        w.writeCharacters(Long.MIN_VALUE + "");
        w.writeEndElement();

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

        w.close();
        strWriter.close();
        String expected = "{\"root\":{\"subchild1\":[" + Integer.MAX_VALUE + "," + Integer.MIN_VALUE + ",\"" + Long.MAX_VALUE + "\",\"" + Long.MIN_VALUE + "\"]}}";
        String actual = strWriter.toString();
View Full Code Here

       
        w.writeStartDocument();
        w.writeStartElement("alice");
        w.writeCharacters("bob");
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertJSONEquals("{\"alice\":{\"$\":\"bob\"}}", strWriter.toString());
View Full Code Here

        w.writeStartElement("david");
        w.writeCharacters("edgar");
        w.writeEndElement();
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertJSONEquals("{\"alice\":{\"bob\":{\"$\":\"charlie\"},"+
View Full Code Here

        w.writeStartElement("bob");
        w.writeCharacters("david");
        w.writeEndElement();
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertJSONEquals("{\"alice\":{\"bob\":[{\"$\":\"charlie\"},{\"$\":\"david\"}]}}",
View Full Code Here

        xsw.writeAttribute("id", "300");
        xsw.writeAttribute("value", "5");
        xsw.writeEndElement();

        xsw.writeEndElement();
        xsw.writeEndDocument ();
        xsw.flush();

        xsw.close();
        strWriter.close();
        System.out.println(strWriter.toString());
View Full Code Here

       
        w.writeAttribute("charlie", "david");
        w.writeCharacters("bob");
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertJSONEquals("{\"alice\":{\"@charlie\":\"david\",\"$\":\"bob\"}}",
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.