Package com.laamella.javamodel.io.OutputStreamFactory

Examples of com.laamella.javamodel.io.OutputStreamFactory.Streamer


        final XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
        final Prefixer prefixer = new Prefixer();

        for (final Node topElement : schema.topElements) {
            outputStreamFactory.stream("", sanitize(schema.name + "_" + topElement.name.localPart) + ".xml", new Streamer() {
                public void stream(OutputStream outputStream) throws XMLStreamException {
                    XMLStreamWriter xmlStreamWriter = outputFactory.createXMLStreamWriter(outputStream);
                    tweakStreamWriter(xmlStreamWriter);
                    xmlStreamWriter.writeStartDocument();
                    writeChildren(xmlStreamWriter, topElement, 0, prefixer);
View Full Code Here


    }

    public void write(final OutputStreamFactory outputDir) throws Exception {
        checkIndentationMatches();
        final String packageDir = packageName.replace('.', File.separatorChar);
        outputDir.stream(packageDir, name + ".java", new Streamer() {
            public void stream(OutputStream outputStream) throws Exception {
                outputStream.write(JavaFile.this.toString().getBytes("utf-8"));
            }
        });
    }
View Full Code Here

TOP

Related Classes of com.laamella.javamodel.io.OutputStreamFactory.Streamer

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.