| |
|
| java.lang.Object org.cyberneko.pull.parsers.Xerces2
Xerces2 | public class Xerces2 implements XMLPullParser(Code) | | An implementation of a pull parser that can use any standard
XNI parser configuration as a driver.
Note:
This class is provided for convenience. However, for the best
performance, a parser should be implemented directly to the
NekoPull interfaces to provide pull parsing functionality.
author: Andy Clark version: $Id$ |
Constructor Summary | |
public | Xerces2() Constructs a pull parser with the standard configuration. | public | Xerces2(XMLPullParserConfiguration config) Constructs a pull parser with the specified configuration. |
Method 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. | public XMLEntityResolver | getEntityResolver() Returns the registered entity resolver. | public XMLErrorHandler | getErrorHandler() Returns the registered error handler. | public boolean | getFeature(String featureId) Returns the state of a feature. | public Locale | getLocale() Returns the locale. | public Object | getProperty(String propertyId) Returns the value of a property. | public XMLEvent | nextEvent() Returns the next event in the document or null if there are
no more events. | public void | setEntityResolver(XMLEntityResolver entityResolver) Sets the entity resolver. | public void | setErrorHandler(XMLErrorHandler errorHandler) Sets the error handler. | public void | setFeature(String featureId, boolean state) Sets the state of a feature. | public void | setInputSource(XMLInputSource inputSource) Sets the input source for the document to parse. | public void | setLocale(Locale locale) Set the locale to use for messages. | public void | setProperty(String propertyId, Object value) Sets the value of a property. |
REUSE_BUFFERS | final protected static String REUSE_BUFFERS(Code) | | Feature identifer: reuse buffers.
|
fConfiguration | protected XMLPullParserConfiguration fConfiguration(Code) | | XNI pull parser configuration.
|
fDone | protected boolean fDone(Code) | | Finished parsing.
|
Xerces2 | public Xerces2()(Code) | | Constructs a pull parser with the standard configuration.
|
Xerces2 | public Xerces2(XMLPullParserConfiguration config)(Code) | | Constructs a pull parser with the specified configuration.
|
cleanup | public void cleanup()(Code) | | 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.
|
getEntityResolver | public XMLEntityResolver getEntityResolver()(Code) | | Returns the registered entity resolver.
|
getErrorHandler | public XMLErrorHandler getErrorHandler()(Code) | | Returns the registered error handler.
|
getFeature | public boolean getFeature(String featureId) throws XMLConfigurationException(Code) | | Returns the state of a feature.
Parameters: featureId - The feature identifier. throws: XMLConfigurationException - Thrown if there is a configurationerror. |
getLocale | public Locale getLocale()(Code) | | Returns the locale.
|
getProperty | public Object getProperty(String propertyId) throws XMLConfigurationException(Code) | | Returns the value of a property.
Parameters: propertyId - The property identifier. throws: XMLConfigurationException - Thrown if there is a configurationerror. |
nextEvent | public XMLEvent nextEvent() throws XNIException, IOException(Code) | | Returns the next event in the document or null if there are
no more events. This method will return one and only one event
if it is available; it will never return an event chain (i.e.
an event with a non-null next field).
exception: XNIException - Any XNI exception, possibly wrapping another exception. exception: IOException - An IO exception from the parser, possiblyfrom a byte stream or character streamsupplied by the parser. See Also: Xerces2.setInputSource |
setEntityResolver | public void setEntityResolver(XMLEntityResolver entityResolver)(Code) | | Sets the entity resolver.
Parameters: entityResolver - The new entity resolver. |
setErrorHandler | public void setErrorHandler(XMLErrorHandler errorHandler)(Code) | | Sets the error handler.
Parameters: errorHandler - The error resolver. |
setFeature | public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code) | | Sets the state of a feature. This method is called by the parser
and gets propagated to components in this parser configuration.
Parameters: featureId - The feature identifier. Parameters: state - The state of the feature. throws: XMLConfigurationException - Thrown if there is a configurationerror. |
setInputSource | public void setInputSource(XMLInputSource inputSource) throws XMLConfigurationException, IOException(Code) | | Sets the input source for the document to parse.
Parameters: inputSource - The document's input source. exception: XMLConfigurationException - Thrown if there is a configuration error when initializing theparser. exception: IOException - Thrown on I/O error. See Also: Xerces2.nextEvent |
setLocale | public void setLocale(Locale locale) throws XNIException(Code) | | Set the locale to use for messages.
Parameters: locale - The locale object to use for localization of messages. exception: XNIException - Thrown if the parser does not support thespecified locale. |
setProperty | public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code) | | Sets the value of a property. This method is called by the parser
and gets propagated to components in this parser configuration.
Parameters: propertyId - The property identifier. Parameters: value - The value of the property. throws: XMLConfigurationException - Thrown if there is a configurationerror. |
|
|
|