Class DOMEventProducer

java.lang.Object
org.exolab.castor.xml.util.DOMEventProducer
All Implemented Interfaces:
EventProducer

public class DOMEventProducer extends Object implements EventProducer
A class for converting a DOM document to SAX events
Version:
$Revision: 6671 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
Author:
Keith Visco
  • Constructor Details

    • DOMEventProducer

      public DOMEventProducer()
      Creates a new DOMEventProducer
    • DOMEventProducer

      public DOMEventProducer(Node node)
      Creates a new DOMEventProducer for the given Node
      Parameters:
      node - the node to create the DOMEventProducer for.
  • Method Details

    • setDocumentHandler

      public void setDocumentHandler(DocumentHandler handler)
      Sets the DocumentHandler to use when firing events
      Specified by:
      setDocumentHandler in interface EventProducer
    • setNode

      public void setNode(Node node)
      Sets the node which is to be converted into SAX events
      Parameters:
      node - the node which is to be converted into SAX events
    • start

      public void start() throws SAXException
      Starts producing the events for the Node which is to be converted into SAX events
      Specified by:
      start in interface EventProducer
      Throws:
      SAXException
    • process

      public static void process(Document document, DocumentHandler handler) throws SAXException
      Walks the given DOM Document and converts it into it's corresponding SAX events
      Parameters:
      document - the Node to process into SAX events
      handler - the DocumentHandler to send events to
      Throws:
      SAXException
    • process

      public static void process(Node node, DocumentHandler handler) throws SAXException
      Breaks down the given node into it's corresponding SAX events
      Parameters:
      node - the Node to process into SAX events
      handler - the DocumentHandler to send events to
      Throws:
      SAXException