Java XMLStreamWriter getXMLStreamWriter(final Writer writer)

Here you can find the source of getXMLStreamWriter(final Writer writer)

Description

Get the XML stream writer.

License

Apache License

Parameter

Parameter Description
writer The output writer.

Exception

Parameter Description
XMLStreamException For errors obtaining an XML stream writer.

Return

The XML stream writer.

Declaration

public static XMLStreamWriter getXMLStreamWriter(final Writer writer) throws XMLStreamException 

Method Source Code

//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);
    }
}

Related

  1. CreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h)
  2. CreateSimpleTagAndContent(XMLStreamWriter serializer, String tag, String content)
  3. CreateTable(XMLStreamWriter serializer)
  4. createXMLStreamWriter(StringWriter outWriter)
  5. exportCoordinateList(XMLStreamWriter writer, List coordinates, String separator)
  6. isEntityExpansionLimitException(XMLStreamException e)
  7. isPrefixDeclared(XMLStreamWriter writer, String nsUri, String prefix)
  8. renderPath(XMLStreamWriter writer, String pathData, String id, String style)
  9. serializeEndpart(XMLStreamWriter writer)