## org.exist.util.serializer
Class DOMStreamer

    java.lang.Object
      org.exist.util.serializer.DOMStreamer

Direct Known Subclasses:
  ExtendedDOMStreamer

public class DOMStreamer
extends java.lang.Object

General purpose class to stream a DOM node to SAX.

Author:
  Wolfgang Meier (wolfgang@exist-db.org)

Constructor Summary
`DOMStreamer()`
`DOMStreamer(org.xml.sax.ContentHandler contentHandler, org.xml.sax.ext.LexicalHandler lexicalHandler)`

Method Summary
`void` `reset()` Reset internal state for reuse.
`void` `serialize(org.w3c.dom.Node node)` Serialize the given node and all its descendants to SAX.
`void` `serialize(org.w3c.dom.Node node, boolean callDocumentEvents)` Serialize the given node and all its descendants to SAX.
`void` `setContentHandler(org.xml.sax.ContentHandler handler)`
`void` `setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)`

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

Constructor Detail

### DOMStreamer

    public DOMStreamer()

### DOMStreamer

    public DOMStreamer(org.xml.sax.ContentHandler contentHandler,
                       org.xml.sax.ext.LexicalHandler lexicalHandler)

Method Detail

### setContentHandler

    public void setContentHandler(org.xml.sax.ContentHandler handler)

### setLexicalHandler

    public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)

### reset

    public void reset()

  Reset internal state for reuse. Registered handlers will be set to null.

### serialize

    public void serialize(org.w3c.dom.Node node)
                   throws org.xml.sax.SAXException

  Serialize the given node and all its descendants to SAX.

  Parameters:
    `node` -
  Throws:
    `org.xml.sax.SAXException`

### serialize

    public void serialize(org.w3c.dom.Node node,
                          boolean callDocumentEvents)
                   throws org.xml.sax.SAXException

  Serialize the given node and all its descendants to SAX. If callDocumentEvents is set to false, startDocument/endDocument events will not be fired.

  Parameters:
    `node` -
    `callDocumentEvents` -
  Throws:
    `org.xml.sax.SAXException`

Copyright (C) Wolfgang Meier. All rights reserved.