org.apache.axiom.util.stax
Class AbstractXMLStreamWriter

java.lang.Object
  extended by org.apache.axiom.util.stax.AbstractXMLStreamWriter
All Implemented Interfaces:
XMLStreamWriter

public abstract class AbstractXMLStreamWriter
extends Object
implements 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
AbstractXMLStreamWriter()
           
 
Method Summary
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 XMLStreamWriter

setNamespaceContext

public final void setNamespaceContext(NamespaceContext context)
                               throws XMLStreamException
Specified by:
setNamespaceContext in interface XMLStreamWriter
Throws:
XMLStreamException

getPrefix

public final String getPrefix(String uri)
                       throws XMLStreamException
Specified by:
getPrefix in interface XMLStreamWriter
Throws:
XMLStreamException

setDefaultNamespace

public final void setDefaultNamespace(String uri)
                               throws XMLStreamException
Specified by:
setDefaultNamespace in interface XMLStreamWriter
Throws:
XMLStreamException

setPrefix

public final void setPrefix(String prefix,
                            String uri)
                     throws XMLStreamException
Specified by:
setPrefix in interface XMLStreamWriter
Throws:
XMLStreamException

writeStartDocument

public final void writeStartDocument()
                              throws XMLStreamException
Specified by:
writeStartDocument in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteStartDocument

protected abstract void doWriteStartDocument()
                                      throws XMLStreamException
Throws:
XMLStreamException

writeStartDocument

public final void writeStartDocument(String encoding,
                                     String version)
                              throws XMLStreamException
Specified by:
writeStartDocument in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteStartDocument

protected abstract void doWriteStartDocument(String encoding,
                                             String version)
                                      throws XMLStreamException
Throws:
XMLStreamException

writeStartDocument

public final void writeStartDocument(String version)
                              throws XMLStreamException
Specified by:
writeStartDocument in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteStartDocument

protected abstract void doWriteStartDocument(String version)
                                      throws XMLStreamException
Throws:
XMLStreamException

writeDTD

public final void writeDTD(String dtd)
                    throws XMLStreamException
Specified by:
writeDTD in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteDTD

protected abstract void doWriteDTD(String dtd)
                            throws XMLStreamException
Throws:
XMLStreamException

writeEndDocument

public final void writeEndDocument()
                            throws XMLStreamException
Specified by:
writeEndDocument in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteEndDocument

protected abstract void doWriteEndDocument()
                                    throws XMLStreamException
Throws:
XMLStreamException

writeStartElement

public final void writeStartElement(String prefix,
                                    String localName,
                                    String namespaceURI)
                             throws XMLStreamException
Specified by:
writeStartElement in interface XMLStreamWriter
Throws:
XMLStreamException

writeStartElement

public final void writeStartElement(String namespaceURI,
                                    String localName)
                             throws XMLStreamException
Specified by:
writeStartElement in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteStartElement

protected abstract void doWriteStartElement(String prefix,
                                            String localName,
                                            String namespaceURI)
                                     throws XMLStreamException
Throws:
XMLStreamException

writeStartElement

public final void writeStartElement(String localName)
                             throws XMLStreamException
Specified by:
writeStartElement in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteStartElement

protected abstract void doWriteStartElement(String localName)
                                     throws XMLStreamException
Throws:
XMLStreamException

writeEndElement

public final void writeEndElement()
                           throws XMLStreamException
Specified by:
writeEndElement in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteEndElement

protected abstract void doWriteEndElement()
                                   throws XMLStreamException
Throws:
XMLStreamException

writeEmptyElement

public final void writeEmptyElement(String prefix,
                                    String localName,
                                    String namespaceURI)
                             throws XMLStreamException
Specified by:
writeEmptyElement in interface XMLStreamWriter
Throws:
XMLStreamException

writeEmptyElement

public final void writeEmptyElement(String namespaceURI,
                                    String localName)
                             throws XMLStreamException
Specified by:
writeEmptyElement in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteEmptyElement

protected abstract void doWriteEmptyElement(String prefix,
                                            String localName,
                                            String namespaceURI)
                                     throws XMLStreamException
Throws:
XMLStreamException

writeEmptyElement

public final void writeEmptyElement(String localName)
                             throws XMLStreamException
Specified by:
writeEmptyElement in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteEmptyElement

protected abstract void doWriteEmptyElement(String localName)
                                     throws XMLStreamException
Throws:
XMLStreamException

writeAttribute

public final void writeAttribute(String prefix,
                                 String namespaceURI,
                                 String localName,
                                 String value)
                          throws XMLStreamException
Specified by:
writeAttribute in interface XMLStreamWriter
Throws:
XMLStreamException

writeAttribute

public final void writeAttribute(String namespaceURI,
                                 String localName,
                                 String value)
                          throws XMLStreamException
Specified by:
writeAttribute in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteAttribute

protected abstract void doWriteAttribute(String prefix,
                                         String namespaceURI,
                                         String localName,
                                         String value)
                                  throws XMLStreamException
Throws:
XMLStreamException

writeAttribute

public final void writeAttribute(String localName,
                                 String value)
                          throws XMLStreamException
Specified by:
writeAttribute in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteAttribute

protected abstract void doWriteAttribute(String localName,
                                         String value)
                                  throws XMLStreamException
Throws:
XMLStreamException

writeNamespace

public final void writeNamespace(String prefix,
                                 String namespaceURI)
                          throws XMLStreamException
Specified by:
writeNamespace in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteNamespace

protected abstract void doWriteNamespace(String prefix,
                                         String namespaceURI)
                                  throws XMLStreamException
Throws:
XMLStreamException

writeDefaultNamespace

public final void writeDefaultNamespace(String namespaceURI)
                                 throws XMLStreamException
Specified by:
writeDefaultNamespace in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteDefaultNamespace

protected abstract void doWriteDefaultNamespace(String namespaceURI)
                                         throws XMLStreamException
Throws:
XMLStreamException

writeCharacters

public final void writeCharacters(char[] text,
                                  int start,
                                  int len)
                           throws XMLStreamException
Specified by:
writeCharacters in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteCharacters

protected abstract void doWriteCharacters(char[] text,
                                          int start,
                                          int len)
                                   throws XMLStreamException
Throws:
XMLStreamException

writeCharacters

public final void writeCharacters(String text)
                           throws XMLStreamException
Specified by:
writeCharacters in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteCharacters

protected abstract void doWriteCharacters(String text)
                                   throws XMLStreamException
Throws:
XMLStreamException

writeCData

public final void writeCData(String data)
                      throws XMLStreamException
Specified by:
writeCData in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteCData

protected abstract void doWriteCData(String data)
                              throws XMLStreamException
Throws:
XMLStreamException

writeComment

public final void writeComment(String data)
                        throws XMLStreamException
Specified by:
writeComment in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteComment

protected abstract void doWriteComment(String data)
                                throws XMLStreamException
Throws:
XMLStreamException

writeEntityRef

public final void writeEntityRef(String name)
                          throws XMLStreamException
Specified by:
writeEntityRef in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteEntityRef

protected abstract void doWriteEntityRef(String name)
                                  throws XMLStreamException
Throws:
XMLStreamException

writeProcessingInstruction

public final void writeProcessingInstruction(String target,
                                             String data)
                                      throws XMLStreamException
Specified by:
writeProcessingInstruction in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteProcessingInstruction

protected abstract void doWriteProcessingInstruction(String target,
                                                     String data)
                                              throws XMLStreamException
Throws:
XMLStreamException

writeProcessingInstruction

public final void writeProcessingInstruction(String target)
                                      throws XMLStreamException
Specified by:
writeProcessingInstruction in interface XMLStreamWriter
Throws:
XMLStreamException

doWriteProcessingInstruction

protected abstract void doWriteProcessingInstruction(String target)
                                              throws XMLStreamException
Throws:
XMLStreamException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.