Package org.codehaus.jettison.badgerfish

Examples of org.codehaus.jettison.badgerfish.BadgerFishXMLStreamWriter.writeEndDocument()


       
        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

       
        w.writeDefaultNamespace("http://some-namespace");
        w.writeCharacters("bob");
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertJSONEquals("{\"alice\":{\"@xmlns\":{\"$\":\"http:\\/\\/some-namespace\"},\"$\":\"bob\"}}",
View Full Code Here

        assertEquals("charlie", w.getNamespaceContext().getPrefix("http://some-other-namespace"));
       
        w.writeCharacters("bob");
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertJSONEquals("{ \"alice\": { \"@xmlns\": { \"$\" : \"http:\\/\\/some-namespace\", \"charlie\" : \"http:\\/\\/some-other-namespace\" }, \"$\" : \"bob\" } }",
View Full Code Here

        w.writeStartElement("charlie", "edgar", "http://some-other-namespace");
        w.writeCharacters("frank");
        w.writeEndElement();
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
        assertJSONEquals(
            "{ \"alice\" : { " +
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.