public final class SAXDriver
extends java.lang.Object
implements org.xml.sax.ext.Locator2, org.xml.sax.ext.Attributes2, org.xml.sax.XMLReader, org.xml.sax.Parser, org.xml.sax.AttributeList
Name | Notes |
---|---|
(URL)/external-general-entities | Value defaults to true |
(URL)/external-parameter-entities | Value defaults to true |
(URL)/is-standalone | (PRELIMINARY) Returns true iff the document's parsing has started (some non-error event after startDocument() was reported) and the document's standalone flag is set. |
(URL)/namespace-prefixes | Value defaults to false (but XML 1.0 names are always reported) |
(URL)/lexical-handler/parameter-entities | Value is fixed at true |
(URL)/namespaces | Value defaults to true |
(URL)/resolve-dtd-uris | (PRELIMINARY) Value defaults to true |
(URL)/string-interning | Value is fixed at true |
(URL)/use-attributes2 | (PRELIMINARY) Value is fixed at true |
(URL)/use-entity-resolver2 | (PRELIMINARY) Value defaults to true |
(URL)/validation | Value is fixed at false |
(URL)/declaration-handler | A declaration handler may be provided. |
(URL)/lexical-handler | A lexical handler may be provided. |
This parser currently implements the SAX1 Parser API, but it may not continue to do so in the future.
Parser
Constructor and Description |
---|
SAXDriver()
Constructs a SAX Parser.
|
Modifier and Type | Method and Description |
---|---|
int |
getColumnNumber()
SAX Locator method (don't invoke on parser);
|
org.xml.sax.ContentHandler |
getContentHandler()
SAX2: Returns the object used to report the logical content of an
XML document.
|
org.xml.sax.DTDHandler |
getDTDHandler()
SAX2: Returns the object used to process declarations related to
notations and unparsed entities.
|
java.lang.String |
getEncoding() |
org.xml.sax.EntityResolver |
getEntityResolver()
SAX2: Returns the object used when resolving external entities
during parsing (both general and parameter entities).
|
org.xml.sax.ErrorHandler |
getErrorHandler()
SAX2: Returns the object used to receive callbacks for XML errors
of all levels (fatal, nonfatal, warning); this is never null;
|
boolean |
getFeature(java.lang.String featureId)
SAX2: Tells the value of the specified feature flag.
|
int |
getIndex(java.lang.String xmlName)
SAX2 Attributes method (don't invoke on parser);
|
int |
getIndex(java.lang.String uri,
java.lang.String local)
SAX2 Attributes method (don't invoke on parser);
|
int |
getLength()
SAX1 AttributeList, SAX2 Attributes method (don't invoke on
parser);
|
int |
getLineNumber()
SAX Locator method (don't invoke on parser);
|
java.lang.String |
getLocalName(int index)
SAX2 Attributes method (don't invoke on parser);
|
java.lang.String |
getName(int index)
SAX1 AttributeList method (don't invoke on parser);
|
java.lang.Object |
getProperty(java.lang.String propertyId)
SAX2: Returns the specified property.
|
java.lang.String |
getPublicId()
SAX Locator method (don't invoke on parser);
|
java.lang.String |
getQName(int index)
SAX2 Attributes method (don't invoke on parser);
|
java.lang.String |
getSystemId()
SAX Locator method (don't invoke on parser);
|
java.lang.String |
getType(int index)
SAX1 AttributeList, SAX2 Attributes method (don't invoke on
parser);
|
java.lang.String |
getType(java.lang.String xmlName)
SAX1 AttributeList, SAX2 Attributes method (don't invoke on
parser);
|
java.lang.String |
getType(java.lang.String uri,
java.lang.String local)
SAX2 Attributes method (don't invoke on parser);
|
java.lang.String |
getURI(int index)
SAX2 Attributes method (don't invoke on parser);
|
java.lang.String |
getValue(int index)
SAX1 AttributeList, SAX2 Attributes method (don't invoke on
parser);
|
java.lang.String |
getValue(java.lang.String xmlName)
SAX1 AttributeList, SAX2 Attributes method (don't invoke on
parser);
|
java.lang.String |
getValue(java.lang.String uri,
java.lang.String local)
SAX Attributes method (don't invoke on parser);
|
java.lang.String |
getXMLVersion() |
boolean |
isDeclared(int index) |
boolean |
isDeclared(java.lang.String qName) |
boolean |
isDeclared(java.lang.String uri,
java.lang.String localName) |
boolean |
isSpecified(int index)
SAX-ext Attributes2 method (don't invoke on parser);
|
boolean |
isSpecified(java.lang.String xmlName)
SAX-ext Attributes2 method (don't invoke on parser);
|
boolean |
isSpecified(java.lang.String uri,
java.lang.String local)
SAX-ext Attributes2 method (don't invoke on parser);
|
void |
lockErrorHandler() |
void |
parse(org.xml.sax.InputSource source)
SAX1, SAX2: Auxiliary API to parse an XML document, used mostly
when no URI is available.
|
void |
parse(java.lang.String systemId)
SAX1, SAX2: Preferred API to parse an XML document, using a
system identifier (URI).
|
void |
setCharacterHandler(nu.validator.htmlparser.common.CharacterHandler characterHandler)
Sets the characterHandler.
|
void |
setContentHandler(org.xml.sax.ContentHandler handler)
SAX2: Assigns the object used to report the logical content of an
XML document.
|
void |
setDocumentHandler(org.xml.sax.DocumentHandler handler)
Deprecated.
SAX2 programs should use the XMLReader interface and a
ContentHandler.
|
void |
setDTDHandler(org.xml.sax.DTDHandler handler)
SAX1, SAX2: Set the DTD handler for this parser.
|
void |
setEntityResolver(org.xml.sax.EntityResolver resolver)
SAX1, SAX2: Set the entity resolver for this parser.
|
void |
setErrorHandler(org.xml.sax.ErrorHandler handler)
SAX1, SAX2: Set the error handler for this parser.
|
void |
setFeature(java.lang.String featureId,
boolean value)
SAX2: Sets the state of feature flags in this parser.
|
void |
setLocale(java.util.Locale locale)
SAX1: Sets the locale used for diagnostics; currently, only
locales using the English language are supported.
|
void |
setProperty(java.lang.String propertyId,
java.lang.Object value)
SAX2: Assigns the specified property.
|
public void setLocale(java.util.Locale locale) throws org.xml.sax.SAXException
setLocale
in interface org.xml.sax.Parser
locale
- The locale for which diagnostics will be generatedorg.xml.sax.SAXException
public org.xml.sax.EntityResolver getEntityResolver()
getEntityResolver
in interface org.xml.sax.XMLReader
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
setEntityResolver
in interface org.xml.sax.Parser
setEntityResolver
in interface org.xml.sax.XMLReader
resolver
- public org.xml.sax.DTDHandler getDTDHandler()
getDTDHandler
in interface org.xml.sax.XMLReader
public void setDTDHandler(org.xml.sax.DTDHandler handler)
setDTDHandler
in interface org.xml.sax.Parser
setDTDHandler
in interface org.xml.sax.XMLReader
handler
- The object to receive DTD events.@Deprecated public void setDocumentHandler(org.xml.sax.DocumentHandler handler)
setDocumentHandler
in interface org.xml.sax.Parser
handler
- The object to receive document events.public org.xml.sax.ContentHandler getContentHandler()
getContentHandler
in interface org.xml.sax.XMLReader
public void setContentHandler(org.xml.sax.ContentHandler handler)
setContentHandler
in interface org.xml.sax.XMLReader
public void lockErrorHandler()
public void setErrorHandler(org.xml.sax.ErrorHandler handler)
setErrorHandler
in interface org.xml.sax.Parser
setErrorHandler
in interface org.xml.sax.XMLReader
handler
- The object to receive error events.public org.xml.sax.ErrorHandler getErrorHandler()
getErrorHandler
in interface org.xml.sax.XMLReader
public void parse(org.xml.sax.InputSource source) throws org.xml.sax.SAXException, java.io.IOException
parse
in interface org.xml.sax.Parser
parse
in interface org.xml.sax.XMLReader
source
- The XML input source. Don't set 'encoding' unless you know for
a fact that it's correct.org.xml.sax.SAXException
- The handlers may throw any SAXException, and the parser
normally throws SAXParseException objects.java.io.IOException
- IOExceptions are normally through through the parser if
there are problems reading the source document.setEntityResolver(org.xml.sax.EntityResolver)
,
setDTDHandler(org.xml.sax.DTDHandler)
,
setContentHandler(org.xml.sax.ContentHandler)
,
setErrorHandler(org.xml.sax.ErrorHandler)
public void parse(java.lang.String systemId) throws org.xml.sax.SAXException, java.io.IOException
parse
in interface org.xml.sax.Parser
parse
in interface org.xml.sax.XMLReader
org.xml.sax.SAXException
java.io.IOException
public boolean getFeature(java.lang.String featureId) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
getFeature
in interface org.xml.sax.XMLReader
org.xml.sax.SAXNotRecognizedException
- thrown if the feature flag is neither built in, nor yet
assigned.org.xml.sax.SAXNotSupportedException
public java.lang.Object getProperty(java.lang.String propertyId) throws org.xml.sax.SAXNotRecognizedException
getProperty
in interface org.xml.sax.XMLReader
org.xml.sax.SAXNotRecognizedException
- thrown if the property value is neither built in, nor yet
stored.public void setFeature(java.lang.String featureId, boolean value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
setFeature
in interface org.xml.sax.XMLReader
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public void setProperty(java.lang.String propertyId, java.lang.Object value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
setProperty
in interface org.xml.sax.XMLReader
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public int getLength()
getLength
in interface org.xml.sax.AttributeList
getLength
in interface org.xml.sax.Attributes
public java.lang.String getURI(int index)
getURI
in interface org.xml.sax.Attributes
public java.lang.String getLocalName(int index)
getLocalName
in interface org.xml.sax.Attributes
public java.lang.String getQName(int index)
getQName
in interface org.xml.sax.Attributes
public java.lang.String getName(int index)
getName
in interface org.xml.sax.AttributeList
public java.lang.String getType(int index)
getType
in interface org.xml.sax.AttributeList
getType
in interface org.xml.sax.Attributes
public java.lang.String getValue(int index)
getValue
in interface org.xml.sax.AttributeList
getValue
in interface org.xml.sax.Attributes
public int getIndex(java.lang.String uri, java.lang.String local)
getIndex
in interface org.xml.sax.Attributes
public int getIndex(java.lang.String xmlName)
getIndex
in interface org.xml.sax.Attributes
public java.lang.String getType(java.lang.String uri, java.lang.String local)
getType
in interface org.xml.sax.Attributes
public java.lang.String getType(java.lang.String xmlName)
getType
in interface org.xml.sax.AttributeList
getType
in interface org.xml.sax.Attributes
public java.lang.String getValue(java.lang.String uri, java.lang.String local)
getValue
in interface org.xml.sax.Attributes
public java.lang.String getValue(java.lang.String xmlName)
getValue
in interface org.xml.sax.AttributeList
getValue
in interface org.xml.sax.Attributes
public boolean isDeclared(int index)
isDeclared
in interface org.xml.sax.ext.Attributes2
java.lang.ArrayIndexOutOfBoundsException
- When the supplied index does not identify an attribute.public boolean isDeclared(java.lang.String qName)
isDeclared
in interface org.xml.sax.ext.Attributes2
java.lang.IllegalArgumentException
- When the supplied names do not identify an attribute.public boolean isDeclared(java.lang.String uri, java.lang.String localName)
isDeclared
in interface org.xml.sax.ext.Attributes2
java.lang.IllegalArgumentException
- When the supplied names do not identify an attribute.public boolean isSpecified(int index)
isSpecified
in interface org.xml.sax.ext.Attributes2
public boolean isSpecified(java.lang.String uri, java.lang.String local)
isSpecified
in interface org.xml.sax.ext.Attributes2
public boolean isSpecified(java.lang.String xmlName)
isSpecified
in interface org.xml.sax.ext.Attributes2
public java.lang.String getPublicId()
getPublicId
in interface org.xml.sax.Locator
public java.lang.String getSystemId()
getSystemId
in interface org.xml.sax.Locator
public int getLineNumber()
getLineNumber
in interface org.xml.sax.Locator
public int getColumnNumber()
getColumnNumber
in interface org.xml.sax.Locator
public void setCharacterHandler(nu.validator.htmlparser.common.CharacterHandler characterHandler)
characterHandler
- the characterHandler to setpublic java.lang.String getEncoding()
getEncoding
in interface org.xml.sax.ext.Locator2
public java.lang.String getXMLVersion()
getXMLVersion
in interface org.xml.sax.ext.Locator2