Package org.codehaus.jettison

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


    public void testPrimitiveInfinityNaN() throws Exception {
        StringWriter strWriter = new StringWriter();
        MappedNamespaceConvention con = new MappedNamespaceConvention();
        AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);

        w.writeStartDocument();
        w.writeStartElement("root");


        w.writeStartElement("subchild1");
        w.writeCharacters("Infinity");
View Full Code Here


    public void testComplexElements() throws Exception {
        StringWriter strWriter = new StringWriter();
        MappedNamespaceConvention con = new MappedNamespaceConvention();
        AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
       
        w.writeStartDocument();
        w.writeStartElement("", "a", "");

        w.writeStartElement("", "o", "");
        w.writeAttribute("class", "string");
        w.writeCharacters("1");
View Full Code Here

    StringWriter strWriter = new StringWriter();
    MappedNamespaceConvention con = new MappedNamespaceConvention();
    AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
    w.serializeAsArray(con.createKey("", "", "array-a"));

    w.writeStartDocument();
    w.writeStartElement("", "array-a", "");

    w.writeStartElement("", "a", "");
    w.writeStartElement("", "n", "");
    w.writeCharacters("1");
View Full Code Here

        StringWriter strWriter = new StringWriter();
        MappedNamespaceConvention con = new MappedNamespaceConvention();
        AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
        w.serializeAsArray(con.createKey("", "", "array-a"));

        w.writeStartDocument();
        w.writeStartElement("", "array-a", "");

        w.writeEndElement();
        w.writeEndDocument();
View Full Code Here

        AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
        w.serializeAsArray(con.createKey("", "", "docs"));
        w.serializeAsArray(con.createKey("", "", "filters"));
        w.serializeAsArray(con.createKey("", "", "hosts"));

        w.writeStartDocument();
        w.writeStartElement("", "docs", "");
        w.writeStartElement("", "doc", "");
       
        w.writeStartElement("", "id", "");
        w.writeCharacters("24");
View Full Code Here

    public void testSingleArrayElementIgnore() throws Exception {
    StringWriter strWriter = new StringWriter();
    MappedNamespaceConvention con = new MappedNamespaceConvention();
    AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);

    w.writeStartDocument();
    w.writeStartElement("", "array-a", "");

    w.writeStartElement("", "a", "");
    w.writeStartElement("", "n", "");
    w.writeCharacters("1");
View Full Code Here

    public void testArraysAndAttributes() throws Exception {
        StringWriter strWriter = new StringWriter();
        MappedNamespaceConvention con = new MappedNamespaceConvention();
        AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
       
        w.writeStartDocument();
        w.writeStartElement("root");
       
        w.writeStartElement("child");
        w.writeAttribute("x", "y");
        w.writeCharacters("value");
View Full Code Here

        Configuration config = new Configuration();
        config.setTypeConverter(new SimpleConverter());
        MappedNamespaceConvention con = new MappedNamespaceConvention(config);
        AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);

        w.writeStartDocument();
        w.writeStartElement("root");
        w.writeCharacters("true");
        w.writeEndElement();

        w.writeEndDocument();
View Full Code Here

        Configuration conf = new Configuration(xtoj);
        conf.setAttributeKey("!");
        MappedNamespaceConvention con = new MappedNamespaceConvention(conf);
        AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
       
        w.writeStartDocument();
        w.writeStartElement("root");
        w.writeAttribute("att", "attvalue");
        w.writeAttribute("http://foo/", "att2", "attvalue");
       
        w.writeEndElement();
View Full Code Here

        MappedNamespaceConvention con = new MappedNamespaceConvention();
        AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
        w.serializeAsArray(con.createKey("", "", "bazs"));
        w.serializeAsArray(con.createKey("", "", "quacks"));

        w.writeStartDocument();
        w.writeStartElement("Foo");
          w.writeStartElement("bazs"); // array
            w.writeStartElement("quacks"); // array
              w.writeStartElement("goof");
              w.writeEndElement();
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.