Package org.codehaus.jettison

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


        w.writeCharacters("test");
        w.writeCharacters("test");
        w.writeCharacters("test".toCharArray(), 0, 4);
        w.writeEndElement();
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":{\"child\":\"testtesttest\"}}", strWriter.toString());
View Full Code Here


        w.writeAttribute("att", "attvalue");
        w.writeAttribute("http://foo/", "att2", "attvalue");
       
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":{\"@att\":\"attvalue\",\"@foo.att2\":\"attvalue\"}}", strWriter.toString());
View Full Code Here

        w.writeStartElement("root");
        w.writeAttribute("att", "attvalue");
        w.writeAttribute("http://foo/", "att2", "attvalue");
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":{\"@att\":\"attvalue\",\"foo.att2\":\"attvalue\"}}", strWriter.toString());
View Full Code Here

        w.writeStartElement("root");
        w.writeAttribute("att", "attvalue");
        w.writeAttribute("http://foo/", "att2", "attvalue");
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":{\"att\":\"attvalue\",\"foo.att2\":\"attvalue\"}}", strWriter.toString());
View Full Code Here

       
        w.writeStartElement("child2");
        w.writeEndElement();
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":{\"child1\":\"\",\"child2\":\"\"}}", strWriter.toString());
View Full Code Here

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

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

          w.writeEndElement();
         
          //w.writeEndElement();
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals("{\"root\":{\"subchild1\":[{\"subchild2\":[\"first sub2\",{\"subchild3\":[\"first sub3\",\"second sub3\"]},\"third sub2\"]},\"sub1\"]}}"
View Full Code Here

      w.writeStartElement("outer");
        w.writeCharacters("test");
      w.writeEndElement();
       
        w.writeEndElement();
        w.writeEndDocument();
       
        w.close();
        strWriter.close();
       
        assertEquals(strWriter.toString(), "{\"root\":{\"subchild1\":[{\"subchild2\":\"first sub2\"},\"text\",\"text1\"],\"outer\":\"test\"}}");
View Full Code Here

        w.writeStartElement("subchild1");
        w.writeCharacters("Not success");
        w.writeEndElement();

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

        w.close();
        strWriter.close();
        String expected = "{\"root\":{\"subchild1\":\"success\"}}";
        String actual = 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.