Here you can find the source of getXMLStreamWriter(final Writer writer)
Parameter | Description |
---|---|
writer | The output writer. |
Parameter | Description |
---|---|
XMLStreamException | For errors obtaining an XML stream writer. |
public static XMLStreamWriter getXMLStreamWriter(final Writer writer) throws XMLStreamException
//package com.java2s; //License from project: Apache License import java.io.Writer; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; public class Main { /**/*from ww w . j a v a 2 s . c o m*/ * The XML output factory. */ private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance(); /** * Get the XML stream writer. * @param writer The output writer. * @return The XML stream writer. * @throws XMLStreamException For errors obtaining an XML stream writer. */ public static XMLStreamWriter getXMLStreamWriter(final Writer writer) throws XMLStreamException { return XML_OUTPUT_FACTORY.createXMLStreamWriter(writer); } }