uk.me.nxg.xoxa.util
Class XMLOutputHandler

java.lang.Object
  extended by uk.me.nxg.xoxa.util.XMLOutputHandler
All Implemented Interfaces:
ContentHandler

public class XMLOutputHandler
extends Object
implements ContentHandler

A content handler which writes out XML


Constructor Summary
XMLOutputHandler(OutputStream stream)
          Create the output handler, with output going to the given stream
XMLOutputHandler(Writer writer)
          Create the output handler, with output going to the given Writer
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 void endPrefixMapping(String prefix)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void processingInstruction(String target, String data)
           
 void setDocumentLocator(Locator locator)
           
 void skippedEntity(String name)
           
 void startDocument()
           
 void startElement(String uri, String localName, String qName, Attributes atts)
           
 void startPrefixMapping(String prefix, String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLOutputHandler

public XMLOutputHandler(Writer writer)
                 throws XoxaException,
                        XMLStreamException
Create the output handler, with output going to the given Writer

Parameters:
writer - the underlying writer to receive the output
Throws:
XMLStreamException - if there is an XML-related problem
XoxaException - if there is a problem not specifically XML-related

XMLOutputHandler

public XMLOutputHandler(OutputStream stream)
                 throws XoxaException,
                        XMLStreamException
Create the output handler, with output going to the given stream

Parameters:
stream - the stream to receive the output
Throws:
XMLStreamException - if there is an XML-related problem
XoxaException - if there is a problem not specifically XML-related
Method Detail

startDocument

public void startDocument()
                   throws XoxaException
Specified by:
startDocument in interface ContentHandler
Throws:
XoxaException

endDocument

public void endDocument()
                 throws XoxaException
Specified by:
endDocument in interface ContentHandler
Throws:
XoxaException

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws XoxaException
Specified by:
startElement in interface ContentHandler
Throws:
XoxaException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws XoxaException
Specified by:
endElement in interface ContentHandler
Throws:
XoxaException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws XoxaException
Specified by:
startPrefixMapping in interface ContentHandler
Throws:
XoxaException

endPrefixMapping

public void endPrefixMapping(String prefix)
                      throws XoxaException
Specified by:
endPrefixMapping in interface ContentHandler
Throws:
XoxaException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws XoxaException
Specified by:
characters in interface ContentHandler
Throws:
XoxaException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws XoxaException
Specified by:
ignorableWhitespace in interface ContentHandler
Throws:
XoxaException

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws XoxaException
Specified by:
processingInstruction in interface ContentHandler
Throws:
XoxaException

setDocumentLocator

public void setDocumentLocator(Locator locator)
Specified by:
setDocumentLocator in interface ContentHandler

skippedEntity

public void skippedEntity(String name)
Specified by:
skippedEntity in interface ContentHandler


Copyright © 2015. All rights reserved.