## javanet.staxutils
Class StAXStreamContentHandler

    java.lang.Object
      org.xml.sax.helpers.DefaultHandler
          javanet.staxutils.StAXContentHandler
              javanet.staxutils.StAXStreamContentHandler

All Implemented Interfaces:
  ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler

    public class StAXStreamContentHandler

extends StAXContentHandler

SAX ContentHandler that writes events to a StAX `XMLStreamWriter`.

Version:
  $Revision: 1.5 $
Author:
  Christian Niles

Field Summary

Fields inherited from class javanet.staxutils.StAXContentHandler
`CDATABuffer, docLocator, isCDATA, namespaces, reporter`

Constructor Summary
`StAXStreamContentHandler()`
`StAXStreamContentHandler(XMLStreamWriter writer)` Constructs an instance that writes SAX events to the specified StAX stream.

Method Summary
`void` `characters(char[] ch, int start, int length)`
`void` `comment(char[] ch, int start, int length)`
`void` `endCDATA()`
`void` `endDocument()`
`void` `endElement(String uri, String localName, String qName)`
`XMLStreamWriter` `getStreamWriter()` Returns a reference to the `XMLStreamWriter`to which SAX events are written.
`void` `ignorableWhitespace(char[] ch, int start, int length)`
`void` `processingInstruction(String target, String data)`
`void` `setStreamWriter(XMLStreamWriter writer)` Sets the `XMLStreamWriter`to which SAX events will be written.
`void` `startDocument()`
`void` `startElement(String uri, String localName, String qName, Attributes attributes)`

Methods inherited from class javanet.staxutils.StAXContentHandler
`endDTD, endEntity, endPrefixMapping, error, fatalError, getCurrentLocation, parseQName, reportException, setDocumentLocator, setXMLReporter, startCDATA, startDTD, startEntity, startPrefixMapping, warning`

Methods inherited from class org.xml.sax.helpers.DefaultHandler
`notationDecl, resolveEntity, skippedEntity, unparsedEntityDecl`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### StAXStreamContentHandler

    public StAXStreamContentHandler()

### StAXStreamContentHandler

    public StAXStreamContentHandler(XMLStreamWriter writer)

  Constructs an instance that writes SAX events to the specified StAX stream.

  Parameters:
    `writer` - The StAX stream to which events will be written.

Method Detail

### getStreamWriter

    public XMLStreamWriter getStreamWriter()

  Returns a reference to the `XMLStreamWriter`to which SAX events are written.

  Returns:
    The `XMLStreamWriter`to which SAX events are written.

### setStreamWriter

    public void setStreamWriter(XMLStreamWriter writer)

  Sets the `XMLStreamWriter`to which SAX events will be written.

  Parameters:
    `writer` - The `XMLStreamWriter`to which SAX events will be written.

### startDocument

    public void startDocument()
                       throws SAXException

  Specified by:
    `startDocument` in interface `ContentHandler`
  Overrides:
    `startDocument` in class `StAXContentHandler`
  Throws:
    `SAXException`

### endDocument

    public void endDocument()
                     throws SAXException

  Specified by:
    `endDocument` in interface `ContentHandler`
  Overrides:
    `endDocument` in class `StAXContentHandler`
  Throws:
    `SAXException`

### startElement

    public void startElement(String uri,
                             String localName,
                             String qName,
                             Attributes attributes)
                      throws SAXException

  Specified by:
    `startElement` in interface `ContentHandler`
  Overrides:
    `startElement` in class `StAXContentHandler`
  Throws:
    `SAXException`

### endElement

    public void endElement(String uri,
                           String localName,
                           String qName)
                    throws SAXException

  Specified by:
    `endElement` in interface `ContentHandler`
  Overrides:
    `endElement` in class `StAXContentHandler`
  Throws:
    `SAXException`

### comment

    public void comment(char[] ch,
                        int start,
                        int length)
                 throws SAXException

  Specified by:
    `comment` in interface `LexicalHandler`
  Overrides:
    `comment` in class `StAXContentHandler`
  Throws:
    `SAXException`

### characters

    public void characters(char[] ch,
                           int start,
                           int length)
                    throws SAXException

  Specified by:
    `characters` in interface `ContentHandler`
  Overrides:
    `characters` in class `StAXContentHandler`
  Throws:
    `SAXException`

### endCDATA

    public void endCDATA()
                  throws SAXException

  Specified by:
    `endCDATA` in interface `LexicalHandler`
  Overrides:
    `endCDATA` in class `StAXContentHandler`
  Throws:
    `SAXException`

### ignorableWhitespace

    public void ignorableWhitespace(char[] ch,
                                    int start,
                                    int length)
                             throws SAXException

  Specified by:
    `ignorableWhitespace` in interface `ContentHandler`
  Overrides:
    `ignorableWhitespace` in class `DefaultHandler`
  Throws:
    `SAXException`

### processingInstruction

    public void processingInstruction(String target,
                                      String data)
                               throws SAXException

  Specified by:
    `processingInstruction` in interface `ContentHandler`
  Overrides:
    `processingInstruction` in class `DefaultHandler`
  Throws:
    `SAXException`