Package javanet.staxutils

Examples of javanet.staxutils.IndentingXMLStreamWriter


        try {
            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.FALSE);

            XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(writer);
            xmlWriter = new IndentingXMLStreamWriter(xmlWriter);

            xmlWriter.writeStartDocument("UTF-8", "1.0");
            xmlWriter.setPrefix("", GEXF_NAMESPACE);
            xmlWriter.writeStartElement(GEXF_NAMESPACE, GEXF);
            xmlWriter.writeNamespace("", GEXF_NAMESPACE);
View Full Code Here


        context.setRootClasses(rootClasses);
        context.initialize();
        AegisWriter<XMLStreamWriter> writer = context.createXMLStreamWriter();
        FileOutputStream output = new FileOutputStream(outputPathname);
        XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(output);
        IndentingXMLStreamWriter indentWriter = new IndentingXMLStreamWriter(xmlWriter);

        Zoo zoo = populateZoo();
        Type aegisType = context.getTypeMapping().getType(zoo.getClass());
        writer.write(zoo, new QName("urn:aegis:demo", "zoo"), false, indentWriter, aegisType);
        xmlWriter.close();
View Full Code Here

        context.setRootClasses(rootClasses);
        context.initialize();
        AegisWriter<XMLStreamWriter> writer = context.createXMLStreamWriter();
        FileOutputStream output = new FileOutputStream(outputPathname);
        XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(output);
        IndentingXMLStreamWriter indentWriter = new IndentingXMLStreamWriter(xmlWriter);

        Zoo zoo = populateZoo();
        Type aegisType = context.getTypeMapping().getType(zoo.getClass());
        writer.write(zoo, new QName("urn:aegis:demo", "zoo"), false, indentWriter, aegisType);
        xmlWriter.close();
View Full Code Here

        context.setRootClasses(rootClasses);
        context.initialize();
        AegisWriter<XMLStreamWriter> writer = context.createXMLStreamWriter();
        FileOutputStream output = new FileOutputStream(outputPathname);
        XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(output);
        IndentingXMLStreamWriter indentWriter = new IndentingXMLStreamWriter(xmlWriter);

        Zoo zoo = populateZoo();
        AegisType aegisType = context.getTypeMapping().getType(zoo.getClass());
        writer.write(zoo, new QName("urn:aegis:demo", "zoo"), false, indentWriter, aegisType);
        xmlWriter.close();
View Full Code Here

        }
        if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) )
        {
            factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE );
        }
        IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) );
        if ( supportWindowsLineEndings )
        {
            serializer.setNewLine( serializer.getLineSeparator() );
        }
        serializer.writeStartDocument( model.getModelEncoding(), "1.0" );
        writeModel( model, "project", serializer );
        serializer.writeEndDocument();
    } //-- void write(Writer, Model)
View Full Code Here

        }
        if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) )
        {
            factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE );
        }
        IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) );
        if ( supportWindowsLineEndings )
        {
            serializer.setNewLine( serializer.getLineSeparator() );
        }
        serializer.writeStartDocument( model.getModelEncoding(), "1.0" );
        writeModel( model, "project", serializer );
        serializer.writeEndDocument();
    } //-- void write(Writer, Model)
View Full Code Here

TOP

Related Classes of javanet.staxutils.IndentingXMLStreamWriter

Copyright © 2018 www.massapicom. 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.