org.apache.axiom.util.stax

## Class AbstractXMLStreamWriter

- java.lang.Object
- - org.apache.axiom.util.stax.AbstractXMLStreamWriter

- All Implemented Interfaces:
    javax.xml.stream.XMLStreamWriter

      public abstract class AbstractXMLStreamWriter
      extends Object
      implements javax.xml.stream.XMLStreamWriter

  Partial implementation of the `XMLStreamWriter` interface. It handles namespace bindings, i.e. the methods related to the namespace context. Subclasses only need to implement write methods that take a prefix together with the namespace URI argument. This class implements all `XMLStreamWriter` methods that have a namespace URI argument, but no prefix argument.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractXMLStreamWriter()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `doWriteAttribute(String localName, String value)`
    `protected abstract void` | `doWriteAttribute(String prefix, String namespaceURI, String localName, String value)`
    `protected abstract void` | `doWriteCData(String data)`
    `protected abstract void` | `doWriteCharacters(char[] text, int start, int len)`
    `protected abstract void` | `doWriteCharacters(String text)`
    `protected abstract void` | `doWriteComment(String data)`
    `protected abstract void` | `doWriteDefaultNamespace(String namespaceURI)`
    `protected abstract void` | `doWriteDTD(String dtd)`
    `protected abstract void` | `doWriteEmptyElement(String localName)`
    `protected abstract void` | `doWriteEmptyElement(String prefix, String localName, String namespaceURI)`
    `protected abstract void` | `doWriteEndDocument()`
    `protected abstract void` | `doWriteEndElement()`
    `protected abstract void` | `doWriteEntityRef(String name)`
    `protected abstract void` | `doWriteNamespace(String prefix, String namespaceURI)`
    `protected abstract void` | `doWriteProcessingInstruction(String target)`
    `protected abstract void` | `doWriteProcessingInstruction(String target, String data)`
    `protected abstract void` | `doWriteStartDocument()`
    `protected abstract void` | `doWriteStartDocument(String version)`
    `protected abstract void` | `doWriteStartDocument(String encoding, String version)`
    `protected abstract void` | `doWriteStartElement(String localName)`
    `protected abstract void` | `doWriteStartElement(String prefix, String localName, String namespaceURI)`
    `NamespaceContext` | `getNamespaceContext()`
    `String` | `getPrefix(String uri)`
    `void` | `setDefaultNamespace(String uri)`
    `void` | `setNamespaceContext(NamespaceContext context)`
    `void` | `setPrefix(String prefix, String uri)`
    `void` | `writeAttribute(String localName, String value)`
    `void` | `writeAttribute(String namespaceURI, String localName, String value)`
    `void` | `writeAttribute(String prefix, String namespaceURI, String localName, String value)`
    `void` | `writeCData(String data)`
    `void` | `writeCharacters(char[] text, int start, int len)`
    `void` | `writeCharacters(String text)`
    `void` | `writeComment(String data)`
    `void` | `writeDefaultNamespace(String namespaceURI)`
    `void` | `writeDTD(String dtd)`
    `void` | `writeEmptyElement(String localName)`
    `void` | `writeEmptyElement(String namespaceURI, String localName)`
    `void` | `writeEmptyElement(String prefix, String localName, String namespaceURI)`
    `void` | `writeEndDocument()`
    `void` | `writeEndElement()`
    `void` | `writeEntityRef(String name)`
    `void` | `writeNamespace(String prefix, String namespaceURI)`
    `void` | `writeProcessingInstruction(String target)`
    `void` | `writeProcessingInstruction(String target, String data)`
    `void` | `writeStartDocument()`
    `void` | `writeStartDocument(String version)`
    `void` | `writeStartDocument(String encoding, String version)`
    `void` | `writeStartElement(String localName)`
    `void` | `writeStartElement(String namespaceURI, String localName)`
    `void` | `writeStartElement(String prefix, String localName, String namespaceURI)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface javax.xml.stream.XMLStreamWriter

      `close, flush, getProperty`

- - ### Constructor Detail

    - #### AbstractXMLStreamWriter

          public AbstractXMLStreamWriter()

  - ### Method Detail

    - #### getNamespaceContext

          public final NamespaceContext getNamespaceContext()

      Specified by:
        `getNamespaceContext` in interface `javax.xml.stream.XMLStreamWriter`

    - #### setNamespaceContext

          public final void setNamespaceContext(NamespaceContext context)
                                         throws javax.xml.stream.XMLStreamException

      Specified by:
        `setNamespaceContext` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### getPrefix

          public final String getPrefix(String uri)
                                 throws javax.xml.stream.XMLStreamException

      Specified by:
        `getPrefix` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### setDefaultNamespace

          public final void setDefaultNamespace(String uri)
                                         throws javax.xml.stream.XMLStreamException

      Specified by:
        `setDefaultNamespace` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### setPrefix

          public final void setPrefix(String prefix,
                                      String uri)
                               throws javax.xml.stream.XMLStreamException

      Specified by:
        `setPrefix` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeStartDocument

          public final void writeStartDocument()
                                        throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeStartDocument` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteStartDocument

          protected abstract void doWriteStartDocument()
                                                throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeStartDocument

          public final void writeStartDocument(String encoding,
                                               String version)
                                        throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeStartDocument` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteStartDocument

          protected abstract void doWriteStartDocument(String encoding,
                                                       String version)
                                                throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeStartDocument

          public final void writeStartDocument(String version)
                                        throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeStartDocument` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteStartDocument

          protected abstract void doWriteStartDocument(String version)
                                                throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeDTD

          public final void writeDTD(String dtd)
                              throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeDTD` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteDTD

          protected abstract void doWriteDTD(String dtd)
                                      throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeEndDocument

          public final void writeEndDocument()
                                      throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeEndDocument` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteEndDocument

          protected abstract void doWriteEndDocument()
                                              throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeStartElement

          public final void writeStartElement(String prefix,
                                              String localName,
                                              String namespaceURI)
                                       throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeStartElement` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeStartElement

          public final void writeStartElement(String namespaceURI,
                                              String localName)
                                       throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeStartElement` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteStartElement

          protected abstract void doWriteStartElement(String prefix,
                                                      String localName,
                                                      String namespaceURI)
                                               throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeStartElement

          public final void writeStartElement(String localName)
                                       throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeStartElement` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteStartElement

          protected abstract void doWriteStartElement(String localName)
                                               throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeEndElement

          public final void writeEndElement()
                                     throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeEndElement` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteEndElement

          protected abstract void doWriteEndElement()
                                             throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeEmptyElement

          public final void writeEmptyElement(String prefix,
                                              String localName,
                                              String namespaceURI)
                                       throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeEmptyElement` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeEmptyElement

          public final void writeEmptyElement(String namespaceURI,
                                              String localName)
                                       throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeEmptyElement` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteEmptyElement

          protected abstract void doWriteEmptyElement(String prefix,
                                                      String localName,
                                                      String namespaceURI)
                                               throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeEmptyElement

          public final void writeEmptyElement(String localName)
                                       throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeEmptyElement` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteEmptyElement

          protected abstract void doWriteEmptyElement(String localName)
                                               throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeAttribute

          public final void writeAttribute(String prefix,
                                           String namespaceURI,
                                           String localName,
                                           String value)
                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeAttribute` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeAttribute

          public final void writeAttribute(String namespaceURI,
                                           String localName,
                                           String value)
                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeAttribute` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteAttribute

          protected abstract void doWriteAttribute(String prefix,
                                                   String namespaceURI,
                                                   String localName,
                                                   String value)
                                            throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeAttribute

          public final void writeAttribute(String localName,
                                           String value)
                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeAttribute` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteAttribute

          protected abstract void doWriteAttribute(String localName,
                                                   String value)
                                            throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeNamespace

          public final void writeNamespace(String prefix,
                                           String namespaceURI)
                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeNamespace` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteNamespace

          protected abstract void doWriteNamespace(String prefix,
                                                   String namespaceURI)
                                            throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeDefaultNamespace

          public final void writeDefaultNamespace(String namespaceURI)
                                           throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeDefaultNamespace` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteDefaultNamespace

          protected abstract void doWriteDefaultNamespace(String namespaceURI)
                                                   throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeCharacters

          public final void writeCharacters(char[] text,
                                            int start,
                                            int len)
                                     throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeCharacters` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteCharacters

          protected abstract void doWriteCharacters(char[] text,
                                                    int start,
                                                    int len)
                                             throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeCharacters

          public final void writeCharacters(String text)
                                     throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeCharacters` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteCharacters

          protected abstract void doWriteCharacters(String text)
                                             throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeCData

          public final void writeCData(String data)
                                throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeCData` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteCData

          protected abstract void doWriteCData(String data)
                                        throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeComment

          public final void writeComment(String data)
                                  throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeComment` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteComment

          protected abstract void doWriteComment(String data)
                                          throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeEntityRef

          public final void writeEntityRef(String name)
                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeEntityRef` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteEntityRef

          protected abstract void doWriteEntityRef(String name)
                                            throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeProcessingInstruction

          public final void writeProcessingInstruction(String target,
                                                       String data)
                                                throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeProcessingInstruction` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteProcessingInstruction

          protected abstract void doWriteProcessingInstruction(String target,
                                                               String data)
                                                        throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### writeProcessingInstruction

          public final void writeProcessingInstruction(String target)
                                                throws javax.xml.stream.XMLStreamException

      Specified by:
        `writeProcessingInstruction` in interface `javax.xml.stream.XMLStreamWriter`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### doWriteProcessingInstruction

          protected abstract void doWriteProcessingInstruction(String target)
                                                        throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

Copyright © The Apache Software Foundation. All Rights Reserved.