org.cyberneko.pull.util
Class EventDispatcher

java.lang.Object
  extended byorg.cyberneko.pull.util.EventDispatcher
All Implemented Interfaces:
org.apache.xerces.xni.parser.XMLDocumentSource

public class EventDispatcher
extends java.lang.Object
implements org.apache.xerces.xni.parser.XMLDocumentSource

This class converts pull parser event objects into XNI document handler callbacks. The user of this class is responsible for queueing of the event objects and should call dispatchEvent for each event to be delivered via the XNI document handler callbacks.

Version:
$Id: EventDispatcher.java,v 1.5 2003/05/02 19:00:20 andyc Exp $
Author:
Andy Clark
See Also:
EventCollector

Nested Class Summary
static class EventDispatcher.ResourceIdentifierProxy
          A proxy object for resource identifier passed to the start general entity method in the XNI document handler.
 
Field Summary
protected  org.apache.xerces.xni.XMLDocumentHandler fDocumentHandler
          The document handler.
 
Constructor Summary
EventDispatcher()
           
 
Method Summary
 void dispatchEvent(XMLEvent event)
          Dispatches a pull parser event object by calling the appropriate
 org.apache.xerces.xni.XMLDocumentHandler getDocumentHandler()
          Returns the document handler.
 void setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler)
          Sets the document handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fDocumentHandler

protected org.apache.xerces.xni.XMLDocumentHandler fDocumentHandler
The document handler.

Constructor Detail

EventDispatcher

public EventDispatcher()
Method Detail

setDocumentHandler

public void setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler)
Sets the document handler.

Specified by:
setDocumentHandler in interface org.apache.xerces.xni.parser.XMLDocumentSource

getDocumentHandler

public org.apache.xerces.xni.XMLDocumentHandler getDocumentHandler()
Returns the document handler.

Specified by:
getDocumentHandler in interface org.apache.xerces.xni.parser.XMLDocumentSource

dispatchEvent

public void dispatchEvent(XMLEvent event)
                   throws org.apache.xerces.xni.XNIException
Dispatches a pull parser event object by calling the appropriate

Parameters:
event - The pull parser event to deliver.
Throws:
org.apache.xerces.xni.XNIException - Thrown by the handler to signal an error.


(C) Copyright 2002-2004, Andy Clark. All rights reserved.