Top Description Methods
org.apache.xerces.xni.parser

public Interface XMLPullParserConfiguration

extends XMLParserConfiguration
Known Direct Implementers
org.apache.xerces.impl.xs.opti.SchemaParsingConfig, org.apache.xerces.parsers.DTDConfiguration, org.apache.xerces.parsers.NonValidatingConfiguration, org.apache.xerces.parsers.XML11Configuration, org.apache.xerces.parsers.XML11DTDConfiguration, org.apache.xerces.parsers.XML11NonValidatingConfiguration
Imports
java.io.IOException, org.apache.xerces.xni.XNIException

Represents a parser configuration that can be used as the configuration for a "pull" parser. A pull parser allows the application to drive the parser instead of having document information events "pushed" to the registered handlers.

A pull parser using this type of configuration first calls the setInputSource method. After the input source is set, the pull parser repeatedly calls the parse(boolean):boolean method. This method returns a value of true if there is more to parse in the document.

Calling the parse(XMLInputSource) is equivalent to setting the input source and calling the parse(boolean):boolean method with a "complete" value of true.

Author
Andy Clark, IBM
Version
$Id: XMLPullParserConfiguration.java 447244 2006-09-18 05:20:40Z mrglavas $

Method Summary

Modifier and TypeMethod and Description
public void
cleanup()

If the application decides to terminate parsing before the xml document is fully parsed, the application should call this method to free any resource allocated during parsing.

public boolean

Returns:

True if there is more document to parse.
parse
(boolean
True if the pull parser should parse the remaining document completely.
complete
)

Parses the document in a pull parsing fashion.

public void
setInputSource(XMLInputSource
The document's input source.
inputSource
)

Sets the input source for the document to parse.

Inherited from org.apache.xerces.xni.parser.XMLParserConfiguration:
addRecognizedFeaturesaddRecognizedPropertiesgetDocumentHandlergetDTDContentModelHandlergetDTDHandlergetEntityResolvergetErrorHandlergetFeaturegetLocalegetPropertyparsesetDocumentHandlersetDTDContentModelHandlersetDTDHandlersetEntityResolversetErrorHandlersetFeaturesetLocalesetProperty

Method Detail

cleanupback to summary
public void cleanup()

If the application decides to terminate parsing before the xml document is fully parsed, the application should call this method to free any resource allocated during parsing. For example, close all opened streams.

parseback to summary
public boolean parse(boolean complete) throws XNIException, IOException

Parses the document in a pull parsing fashion.

Parameters
complete:boolean

True if the pull parser should parse the remaining document completely.

Returns:boolean

True if there is more document to parse.

Exceptions
XNIException:
Any XNI exception, possibly wrapping another exception.
IOException:
An IO exception from the parser, possibly from a byte stream or character stream supplied by the parser.
See Also
setInputSource
setInputSourceback to summary
public void setInputSource(XMLInputSource inputSource) throws XMLConfigurationException, IOException

Sets the input source for the document to parse.

Parameters
inputSource:XMLInputSource

The document's input source.

Exceptions
XMLConfigurationException:
Thrown if there is a configuration error when initializing the parser.
IOException:
Thrown on I/O error.
See Also
parse(boolean)