This interface adds three extra methods to the XMLReader interface that allow XML parsers to support incremental parsing. Support for this interface is optional, since not all underlying XML parsers support this functionality.
When the parser is instantiated it is ready to begin accepting data from the feed method immediately. After parsing has been finished with a call to close the reset method must be called to make the parser ready to accept new data, either from feed or using the parse method.
Note that these methods must not be called during parsing, that is, after parse has been called and before it returns.
By default, the class also implements the parse method of the XMLReader interface using the feed, close and reset methods of the IncrementalParser interface as a convenience to SAX 2.0 driver writers.
There are no implemented interfaces.
There are no attributes in this class.
close()
This method is called when the entire XML document has been passed to the parser through the feed method, to notify the parser that there are no more data. This allows the parser to do the final checks on the document and empty the internal data buffer.
The parser will not be ready to parse another document until the reset method has been called.
close may raise SAXException.
feed(data)
This method gives the raw XML data in the data parameter to the parser and makes it parse the data, emitting the corresponding events. It is allowed for XML constructs to be split across several calls to feed.
feed may raise SAXException.
getContentHandler()
Returns the current ContentHandler.
getDTDHandler()
Returns the current DTD handler.
getEntityResolver()
Returns the current EntityResolver.
getErrorHandler()
Returns the current ErrorHandler.
getFeature(name)
Looks up and returns the state of a SAX2 feature.
getProperty(name)
Looks up and returns the value of a SAX2 property.
parse(source)
prepareParser(source)
This method is called by the parse implementation to allow the SAX 2.0 driver to prepare itself for parsing.
reset()
This method is called after close has been called to reset the parser so that it is ready to parse new documents. The results of calling parse or feed after close without calling reset are undefined.
setContentHandler(handler)
Registers a new object to receive document content events.
setDTDHandler(handler)
Register an object to receive basic DTD-related events.
setEntityResolver(resolver)
Register an object to resolve external entities.
setErrorHandler(handler)
Register an object to receive error-message events.
setFeature(name, state)
Sets the state of a SAX2 feature.
setLocale(locale)
Allow an application to set the locale for errors and warnings.
SAX parsers are not required to provide localization for errors and warnings; if they cannot support the requested locale, however, they must throw a SAX exception. Applications may request a locale change in the middle of a parse.
setProperty(name, value)
Sets the value of a SAX2 property.