|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An incremental generator of SAX events.
SAX events are generated by calling a SAX ContentHandler when the generateEvents() method of this interface is called. SAX events may be generated during XML parsing or from any other data source.
When generateEvents() is called, only a subset of events are generated, so that not all events need to be queued in memory. Implementations should take care to generate a reasonably small set of events, or provide user control over the number of events generated.
Field Summary | |
static java.lang.String |
NAMESPACES_FEATURE
The SAX feature: http://xml.org/sax/features/namespaces
This feature must be set for SAX parsers used to generate events, or
namespace information will not be correctly reported. |
Method Summary | |
void |
close(boolean completeParsing)
Closes the event source to free up resources and stops generating events. |
boolean |
generateEvents()
Generates a subset of SAX events and returns true if more events are still available. |
void |
setContentHandler(org.xml.sax.ContentHandler contentHandler)
Sets the content handler to receive SAX events. |
Field Detail |
public static final java.lang.String NAMESPACES_FEATURE
http://xml.org/sax/features/namespaces
This feature must be set for SAX parsers used to generate events, or
namespace information will not be correctly reported.Method Detail |
public void setContentHandler(org.xml.sax.ContentHandler contentHandler)
This method is called by SaxIterator before it calls generateEvents().
Not all handler methods need be called by a generator. The methods used are as follows and all other method calls are ignored.
public boolean generateEvents() throws java.io.IOException, XmlIteratorException
java.io.IOException
- if an error occurs retrieving input data.XmlIteratorException
- if an error occurs processing input data.public void close(boolean completeParsing) throws java.io.IOException, XmlIteratorException
Even when completeParsing is true, no events should be generated by this method or by subsequent calls to generateEvents().
completeParsing
- is true if parsing and reading of the input
source should be completed during close, or false to abort parsing and
reading.java.io.IOException
- if an error occurs retrieving input data.XmlIteratorException
- if an error occurs processing input data.
|
Copyright (c) 2003 Mark T. Hayes; All Rights Reserved | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |