public class SAXParser extends Object
| Modifier and Type | Method and Description |
|---|---|
ContentHandler |
getContentHandler()
Return the current content handler.
|
DTDHandler |
getDTDHandler()
Return the current DTD handler.
|
EntityResolver |
getEntityResolver()
Return the current entity resolver.
|
ErrorHandler |
getErrorHandler()
Return the current error handler.
|
boolean |
getFeature(String featureId)
Query the current state of any feature in a SAX2 parser.
|
String[] |
getFeaturesRecognized()
Returns a list of features that this parser recognizes.
|
Locator |
getLocator()
return the locator being used by the parser
|
String[] |
getPropertiesRecognized()
Returns a list of properties that this parser recognizes.
|
Object |
getProperty(String propertyId)
Return the current value of a property in a SAX2 parser.
|
boolean |
isFeatureRecognized(String featureId)
Returns true if the specified feature is recognized.
|
boolean |
isPropertyRecognized(String propertyId)
Returns true if the specified property is recognized.
|
void |
parse(InputSource source)
Parses the specified input source.
|
void |
parse(String systemID)
Parses the input source specified by the given system identifier.
|
void |
reset()
Resets the parser.
|
void |
setContentHandler(ContentHandler handler)
Allow an application to register a content event handler.
|
void |
setDTDHandler(DTDHandler handler)
Allow an application to register a DTD event handler.
|
void |
setEntityResolver(EntityResolver resolver)
Sets the resolver used to resolve external entities.
|
void |
setErrorHandler(ErrorHandler handler)
Sets the error handler.
|
void |
setFeature(String featureId,
boolean state)
Set the state of any feature in a SAX2 parser.
|
void |
setLocale(Locale locale)
Set the locale to use for messages.
|
void |
setProperty(String propertyId,
Object value)
Set the value of any property in a SAX2 parser.
|
public String[] getFeaturesRecognized()
public String[] getPropertiesRecognized()
public void reset()
public void setFeature(String featureId, boolean state) throws SAXNotSupportedException
featureId - The unique identifier (URI) of the feature.state - The requested state of the feature (true or false).SAXNotRecognizedException - If the requested feature is
not known.SAXNotSupportedException - If the requested feature is
known, but the requested state
is not supported.public boolean getFeature(String featureId) throws SAXNotSupportedException
featureId - The unique identifier (URI) of the feature
being set.SAXNotRecognizedException - If the requested feature is
not known.SAXNotSupportedExceptionpublic void setProperty(String propertyId, Object value) throws SAXNotSupportedException
propertyId - The unique identifier (URI) of the property
being set.value - The value to which the property is being set.SAXNotRecognizedException - If the requested property is
not known.SAXNotSupportedException - If the requested property is
known, but the requested
value is not supported.public Object getProperty(String propertyId) throws SAXNotSupportedException
propertyId - The unique identifier (URI) of the property
being set.SAXNotRecognizedException - If the requested property is
not known.SAXNotSupportedExceptionpublic boolean isFeatureRecognized(String featureId)
public boolean isPropertyRecognized(String propertyId)
public final Locator getLocator()
public void setEntityResolver(EntityResolver resolver)
resolver - The new entity resolver. Passing a null value will
uninstall the currently installed resolver.public EntityResolver getEntityResolver()
setEntityResolver(org.xml.sax.EntityResolver)public void setErrorHandler(ErrorHandler handler)
handler - The new error handler.public ErrorHandler getErrorHandler()
setErrorHandler(org.xml.sax.ErrorHandler)public void parse(InputSource source) throws SAXException, IOException
source - The input source.SAXException - Throws exception on SAX error.IOException - Throws exception on i/o error.public void parse(String systemID) throws SAXException, IOException
This method is equivalent to the following:
parse(new InputSource(systemId));
systemID - The input source.SAXException - Throws exception on SAX error.IOException - Throws exception on i/o error.public void setLocale(Locale locale)
locale - The locale object to use for localization of messages.SAXException - An exception thrown if the parser does not
support the specified locale.public void setDTDHandler(DTDHandler handler)
If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
handler - The DTD handler.NullPointerException - If the handler
argument is null.getDTDHandler()public DTDHandler getDTDHandler()
setDTDHandler(org.xml.sax.DTDHandler)public void setContentHandler(ContentHandler handler)
If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
handler - The content handler.NullPointerException - If the handler
argument is null.getContentHandler()public ContentHandler getContentHandler()
setContentHandler(org.xml.sax.ContentHandler)Copyright © 1999–2017 Apache OODT. All rights reserved.