org.modeshape.common.xml

## Class StreamingContentHandler

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - org.modeshape.common.xml.StreamingContentHandler

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

      public class StreamingContentHandler
      extends DefaultHandler

  Class that adapts an arbitrary, open `OutputStream` to the `ContentHandler` interface. SAX events invoked on this object will be translated into their corresponding XML text and written to the output stream.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_ENCODING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreamingContentHandler(OutputStream os)`
    `StreamingContentHandler(OutputStream os, Collection<String> unexportableNamespaces)`
    `StreamingContentHandler(OutputStream os, Collection<String> unexportableNamespaces, String encoding)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `characters(char[] ch, int start, int length)`
    `void` | `endDocument()`
    `void` | `endElement(String uri, String localName, String name)`
    `void` | `startDocument()`
    `void` | `startElement(String uri, String localName, String name, Attributes attributes)`
    `void` | `startPrefixMapping(String prefix, String uri)`

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warning`

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

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

- - ### Field Detail

    - #### DEFAULT_ENCODING

          public static final String DEFAULT_ENCODING

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StreamingContentHandler

          public StreamingContentHandler(OutputStream os)

    - #### StreamingContentHandler

          public StreamingContentHandler(OutputStream os,
                                 Collection<String> unexportableNamespaces)

    - #### StreamingContentHandler

          public StreamingContentHandler(OutputStream os,
                                 Collection<String> unexportableNamespaces,
                                 String encoding)
                                  throws UnsupportedEncodingException

      Throws:
        `UnsupportedEncodingException`

  - ### Method Detail

    - #### characters

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

      Specified by:
        `characters` in interface `ContentHandler`
      Overrides:
        `characters` in class `DefaultHandler`
      Throws:
        `SAXException`
      See Also:
        `DefaultHandler.characters(char[], int, int)`

    - #### startDocument

          public void startDocument()
                             throws SAXException

      Specified by:
        `startDocument` in interface `ContentHandler`
      Overrides:
        `startDocument` in class `DefaultHandler`
      Throws:
        `SAXException`
      See Also:
        `DefaultHandler.startDocument()`

    - #### endDocument

          public void endDocument()
                           throws SAXException

      Specified by:
        `endDocument` in interface `ContentHandler`
      Overrides:
        `endDocument` in class `DefaultHandler`
      Throws:
        `SAXException`
      See Also:
        `DefaultHandler.endDocument()`

    - #### startElement

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

      Specified by:
        `startElement` in interface `ContentHandler`
      Overrides:
        `startElement` in class `DefaultHandler`
      Throws:
        `SAXException`
      See Also:
        `DefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)`

    - #### endElement

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

      Specified by:
        `endElement` in interface `ContentHandler`
      Overrides:
        `endElement` in class `DefaultHandler`
      Throws:
        `SAXException`
      See Also:
        `DefaultHandler.endElement(java.lang.String, java.lang.String, java.lang.String)`

    - #### startPrefixMapping

          public void startPrefixMapping(String prefix,
                                String uri)

      Specified by:
        `startPrefixMapping` in interface `ContentHandler`
      Overrides:
        `startPrefixMapping` in class `DefaultHandler`
      See Also:
        `DefaultHandler.startPrefixMapping(java.lang.String, java.lang.String)`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.