Package javax.xml.stream

Examples of javax.xml.stream.XMLOutputFactory.createXMLStreamWriter()


   

    public static XMLStreamWriter createXMLStreamWriter(Writer out) {
        XMLOutputFactory factory = getXMLOutputFactory();
        try {
            return factory.createXMLStreamWriter(out);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Cant' create XMLStreamWriter", e);
        } finally {
            returnXMLOutputFactory(factory);
        }
View Full Code Here


        if (encoding == null) {
            encoding = "UTF-8";
        }
        XMLOutputFactory factory = getXMLOutputFactory();
        try {
            return factory.createXMLStreamWriter(out, encoding);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Cant' create XMLStreamWriter", e);
        } finally {
            returnXMLOutputFactory(factory);
        }
View Full Code Here

    }
   
    public static XMLStreamWriter createXMLStreamWriter(Result r) {
        XMLOutputFactory factory = getXMLOutputFactory();
        try {
            return factory.createXMLStreamWriter(r);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Cant' create XMLStreamWriter", e);
        } finally {
            returnXMLOutputFactory(factory);
        }
View Full Code Here

            writer = mc.getContent(XMLStreamWriter.class);
            if (writer == null) {
                XMLOutputFactory factory = (XMLOutputFactory)mc.get(XMLOutputFactory.class.getName());
                if (factory != null) {
                    try {
                        writer = factory.createXMLStreamWriter(os);
                    } catch (XMLStreamException e) {
                        throw ExceptionUtils.toInternalServerErrorException(
                            new RuntimeException("Cant' create XMLStreamWriter", e), null);
                    }
                }
View Full Code Here

        policy.setLogLevel(Level.INFO);
        policy.setResourceBundleName("Trace_Messages.properties");
       
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        StringWriter sw = new StringWriter();
        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
        processor.write(policy, writer);
        writer.close();
       
        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        StringReader sr = new StringReader(sw.toString());
View Full Code Here

            comp.setURI(component.getURI());
            composite.getComponents().add(comp);
            comp.getReferences().add(reference);

            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer);
            processor.write(composite, streamWriter);
        } catch (Exception e) {
            throw new IOException(e.getMessage());
        }
    }
View Full Code Here

       
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            //outputFactory.setProperty("javax.xml.stream.isPrefixDefaulting",Boolean.TRUE);
            XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bos);
           
            processor.write(composite, writer);
            writer.flush();
            writer.close();
        } catch (Exception ex) {
View Full Code Here

            StAXArtifactProcessor<Composite> processor = staxProcessors.getProcessor(Composite.class);
           
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            try {
                XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
                XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bos);
                processor.write(composite, writer);
                writer.flush();
                writer.close();
            } catch (Exception ex) {
                System.out.println(ex.toString());
View Full Code Here

        XMLOutputFactory outputFactory =
            nodeFactory.getExtensionPointRegistry().getExtensionPoint(FactoryExtensionPoint.class)
                .getFactory(XMLOutputFactory.class);

        try {
            XMLStreamWriter xmlStreamWriter = outputFactory.createXMLStreamWriter(bos);
            compositeProcessor.write(composite, xmlStreamWriter, new ProcessorContext(nodeFactory.registry));
            xmlStreamWriter.flush();
        } catch(Exception ex) {
            return ex.toString();
        }
View Full Code Here

   

    public static XMLStreamWriter createXMLStreamWriter(Writer out) {
        XMLOutputFactory factory = getXMLOutputFactory();
        try {
            return factory.createXMLStreamWriter(out);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Cant' create XMLStreamWriter", e);
        } finally {
            returnXMLOutputFactory(factory);
        }
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.