org.cyberneko.pull.util
Class EventIterator

java.lang.Object
  extended byorg.cyberneko.pull.util.EventIterator
All Implemented Interfaces:
XMLEventIterator

public class EventIterator
extends java.lang.Object
implements XMLEventIterator

This class contains a set of utility functions to allow applications to more conveniently iterate XML events instead of having to call nextEvent for each event in the event stream.

Note: Currently, the XMLEventIterator interface only contains the single, low-level nextToken method for iterating XML events. The EventIterator utility class is provided to handle this shortcoming. As this API progresses, it is believed that additional methods will be added to the XMLEventIterator interface. However, this will be decided by actual users of the API. Please let me know if you have any suggestions or comments.

Version:
$Id: EventIterator.java,v 1.2 2003/01/28 20:00:30 andyc Exp $
Author:
Andy Clark

Field Summary
protected  int fElementDepth
          Element depth.
protected  XMLEventIterator fEventIterator
          XML event iterator.
protected  XMLEvent fPushbackEvent
          Pushback event.
 
Constructor Summary
EventIterator(XMLEventIterator iterator)
          Constructs an event iterator from the specified event iterator.
 
Method Summary
 XMLEvent nextEvent()
          Returns the next event.
 XMLEvent nextEvent(short type)
          Returns the nextEvent of the given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fEventIterator

protected XMLEventIterator fEventIterator
XML event iterator.


fPushbackEvent

protected XMLEvent fPushbackEvent
Pushback event.


fElementDepth

protected int fElementDepth
Element depth.

Constructor Detail

EventIterator

public EventIterator(XMLEventIterator iterator)
Constructs an event iterator from the specified event iterator.

Method Detail

nextEvent

public XMLEvent nextEvent()
                   throws java.io.IOException,
                          org.apache.xerces.xni.XNIException
Returns the next event.

Specified by:
nextEvent in interface XMLEventIterator
Throws:
org.apache.xerces.xni.XNIException - Any XNI exception, possibly wrapping another exception.
java.io.IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the parser.

nextEvent

public XMLEvent nextEvent(short type)
                   throws java.io.IOException,
                          org.apache.xerces.xni.XNIException
Returns the nextEvent of the given type.

Throws:
java.io.IOException
org.apache.xerces.xni.XNIException


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