Examples of IndentingXMLStreamWriter


Examples of javanet.staxutils.IndentingXMLStreamWriter

        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

Examples of javanet.staxutils.IndentingXMLStreamWriter

        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

Examples of javanet.staxutils.IndentingXMLStreamWriter

        }
        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

Examples of javanet.staxutils.IndentingXMLStreamWriter

        }
        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

Examples of org.jvnet.hk2.config.IndentingXMLStreamWriter

    public String serializeConfigBean(ConfigBeanProxy configBean) {
        if (configBean == null) return null;
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        XMLOutputFactory xmlFactory = XMLOutputFactory.newInstance();
        XMLStreamWriter writer = null;
        IndentingXMLStreamWriter indentingXMLStreamWriter = null;
        String s = null;
        try {
            writer = xmlFactory.createXMLStreamWriter(new BufferedOutputStream(bos));
            indentingXMLStreamWriter = new IndentingXMLStreamWriter(writer);
            Dom configBeanDom = Dom.unwrap(configBean);
            configBeanDom.writeTo(configBeanDom.model.getTagName(), indentingXMLStreamWriter);
            indentingXMLStreamWriter.flush();
            s = bos.toString();
        } catch (XMLStreamException e) {
            if (LOG.isLoggable(Level.FINE)) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            }
            return null;
        } finally {
            try {
                if (bos != null)
                    bos.close();
                if (writer != null)
                    writer.close();
                if (indentingXMLStreamWriter != null)
                    indentingXMLStreamWriter.close();
            } catch (IOException e) {
                if (LOG.isLoggable(Level.FINE)) {
                    LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
                }
            } catch (XMLStreamException e) {
View Full Code Here

Examples of org.jvnet.hk2.config.IndentingXMLStreamWriter

    public String serializeConfigBean(ConfigBeanProxy configBean) {
        if (configBean == null) return null;
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        XMLOutputFactory xmlFactory = XMLOutputFactory.newInstance();
        XMLStreamWriter writer = null;
        IndentingXMLStreamWriter indentingXMLStreamWriter = null;
        String s = null;
        try {
            writer = xmlFactory.createXMLStreamWriter(new BufferedOutputStream(bos));
            indentingXMLStreamWriter = new IndentingXMLStreamWriter(writer);
            Dom configBeanDom = Dom.unwrap(configBean);
            configBeanDom.writeToXml();
            configBeanDom.writeTo(configBeanDom.model.getTagName(), indentingXMLStreamWriter);
            indentingXMLStreamWriter.flush();
            s = bos.toString();
        } catch (XMLStreamException e) {
            LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            return null;
        } finally {
            try {
                if (bos != null)
                    bos.close();
                if (writer != null)
                    writer.close();
                if (indentingXMLStreamWriter != null)
                    indentingXMLStreamWriter.close();
            } catch (IOException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            } catch (XMLStreamException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            }
View Full Code Here

Examples of org.jvnet.hk2.config.IndentingXMLStreamWriter

    public String serializeConfigBean(ConfigBeanProxy configBean) {
        if (configBean == null) return null;
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        XMLOutputFactory xmlFactory = XMLOutputFactory.newInstance();
        XMLStreamWriter writer = null;
        IndentingXMLStreamWriter indentingXMLStreamWriter = null;
        String s = null;
        try {
            writer = xmlFactory.createXMLStreamWriter(new BufferedOutputStream(bos));
            indentingXMLStreamWriter = new IndentingXMLStreamWriter(writer);
            Dom configBeanDom = Dom.unwrap(configBean);
            configBeanDom.writeToXml();
            configBeanDom.writeTo(configBeanDom.model.getTagName(), indentingXMLStreamWriter);
            indentingXMLStreamWriter.flush();
            s = bos.toString();
        } catch (XMLStreamException e) {
            LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            return null;
        } finally {
            try {
                if (bos != null)
                    bos.close();
                if (writer != null)
                    writer.close();
                if (indentingXMLStreamWriter != null)
                    indentingXMLStreamWriter.close();
            } catch (IOException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            } catch (XMLStreamException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            }
View Full Code Here

Examples of org.jvnet.hk2.config.IndentingXMLStreamWriter

    public String serializeConfigBean(ConfigBeanProxy configBean) {
        if (configBean == null) return null;
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        XMLOutputFactory xmlFactory = XMLOutputFactory.newInstance();
        XMLStreamWriter writer = null;
        IndentingXMLStreamWriter indentingXMLStreamWriter = null;
        String s = null;
        try {
            writer = xmlFactory.createXMLStreamWriter(new BufferedOutputStream(bos));
            indentingXMLStreamWriter = new IndentingXMLStreamWriter(writer);
            Dom configBeanDom = Dom.unwrap(configBean);
            configBeanDom.writeTo(configBeanDom.model.getTagName(), indentingXMLStreamWriter);
            indentingXMLStreamWriter.flush();
            s = bos.toString();
        } catch (XMLStreamException e) {
            LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            return null;
        } finally {
            try {
                if (bos != null)
                    bos.close();
                if (writer != null)
                    writer.close();
                if (indentingXMLStreamWriter != null)
                    indentingXMLStreamWriter.close();
            } catch (IOException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            } catch (XMLStreamException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            }
View Full Code Here

Examples of org.jvnet.hk2.config.IndentingXMLStreamWriter

    public String serializeConfigBean(ConfigBeanProxy configBean) {
        if (configBean == null) return null;
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        XMLOutputFactory xmlFactory = XMLOutputFactory.newInstance();
        XMLStreamWriter writer = null;
        IndentingXMLStreamWriter indentingXMLStreamWriter = null;
        String s = null;
        try {
            writer = xmlFactory.createXMLStreamWriter(new BufferedOutputStream(bos));
            indentingXMLStreamWriter = new IndentingXMLStreamWriter(writer);
            Dom configBeanDom = Dom.unwrap(configBean);
            configBeanDom.writeToXml();
            configBeanDom.writeTo(configBeanDom.model.getTagName(), indentingXMLStreamWriter);
            indentingXMLStreamWriter.flush();
            s = bos.toString();
        } catch (XMLStreamException e) {
            LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            return null;
        } finally {
            try {
                if (bos != null)
                    bos.close();
                if (writer != null)
                    writer.close();
                if (indentingXMLStreamWriter != null)
                    indentingXMLStreamWriter.close();
            } catch (IOException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            } catch (XMLStreamException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            }
View Full Code Here

Examples of org.jvnet.hk2.config.IndentingXMLStreamWriter

    public String serializeConfigBean(ConfigBeanProxy configBean) {
        if (configBean == null) return null;
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        XMLOutputFactory xmlFactory = XMLOutputFactory.newInstance();
        XMLStreamWriter writer = null;
        IndentingXMLStreamWriter indentingXMLStreamWriter = null;
        String s = null;
        try {
            writer = xmlFactory.createXMLStreamWriter(new BufferedOutputStream(bos));
            indentingXMLStreamWriter = new IndentingXMLStreamWriter(writer);
            Dom configBeanDom = Dom.unwrap(configBean);
            configBeanDom.writeToXml();
            configBeanDom.writeTo(configBeanDom.model.getTagName(), indentingXMLStreamWriter);
            indentingXMLStreamWriter.flush();
            s = bos.toString();
        } catch (XMLStreamException e) {
            LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            return null;
        } finally {
            try {
                if (bos != null)
                    bos.close();
                if (writer != null)
                    writer.close();
                if (indentingXMLStreamWriter != null)
                    indentingXMLStreamWriter.close();
            } catch (IOException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            } catch (XMLStreamException e) {
                LOG.log(Level.FINE, "Cannot serialize the configbean: " + configBean.toString(), e);
            }
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.