Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.xml.aelfred2.SAXDriver
public final class SAXDriver
extends java.lang.Object
implements Locator, Attributes2, XMLReader, Parser, 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. |
Parser
Constructor Summary | |
|
Method Summary | |
int |
|
ContentHandler |
|
DTDHandler |
|
EntityResolver |
|
ErrorHandler |
|
boolean |
|
int |
|
int |
|
int |
|
int |
|
String |
|
String |
|
Object |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
String |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public int getColumnNumber()
SAX Locator method (don't invoke on parser);
- Specified by:
- getColumnNumber in interface Locator
public ContentHandler getContentHandler()
SAX2: Returns the object used to report the logical content of an XML document.
- Specified by:
- getContentHandler in interface XMLReader
public DTDHandler getDTDHandler()
SAX2: Returns the object used to process declarations related to notations and unparsed entities.
- Specified by:
- getDTDHandler in interface XMLReader
public EntityResolver getEntityResolver()
SAX2: Returns the object used when resolving external entities during parsing (both general and parameter entities).
- Specified by:
- getEntityResolver in interface XMLReader
public ErrorHandler getErrorHandler()
SAX2: Returns the object used to receive callbacks for XML errors of all levels (fatal, nonfatal, warning); this is never null;
- Specified by:
- getErrorHandler in interface XMLReader
public boolean getFeature(String featureId) throws SAXNotRecognizedException, SAXNotSupportedException
SAX2: Tells the value of the specified feature flag.
- Specified by:
- getFeature in interface XMLReader
- Throws:
SAXNotRecognizedException
- thrown if the feature flag is neither built in, nor yet assigned.
public int getIndex(String xmlName)
SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getIndex in interface Attributes
public int getIndex(String uri, String local)
SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getIndex in interface Attributes
public int getLength()
SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getLength in interface Attributes
- getLength in interface AttributeList
public int getLineNumber()
SAX Locator method (don't invoke on parser);
- Specified by:
- getLineNumber in interface Locator
public String getLocalName(int index)
SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getLocalName in interface Attributes
public String getName(int index)
SAX1 AttributeList method (don't invoke on parser);
- Specified by:
- getName in interface AttributeList
public Object getProperty(String propertyId) throws SAXNotRecognizedException
SAX2: Returns the specified property.
- Specified by:
- getProperty in interface XMLReader
- Throws:
SAXNotRecognizedException
- thrown if the property value is neither built in, nor yet stored.
public String getPublicId()
SAX Locator method (don't invoke on parser);
- Specified by:
- getPublicId in interface Locator
public String getQName(int index)
SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getQName in interface Attributes
public String getSystemId()
SAX Locator method (don't invoke on parser);
- Specified by:
- getSystemId in interface Locator
public String getType(String xmlName)
SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getType in interface Attributes
- getType in interface AttributeList
public String getType(String uri, String local)
SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getType in interface Attributes
public String getType(int index)
SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getType in interface Attributes
- getType in interface AttributeList
public String getURI(int index)
SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getURI in interface Attributes
public String getValue(String xmlName)
SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getValue in interface Attributes
- getValue in interface AttributeList
public String getValue(String uri, String local)
SAX Attributes method (don't invoke on parser);
- Specified by:
- getValue in interface Attributes
public String getValue(int index)
SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
- Specified by:
- getValue in interface Attributes
- getValue in interface AttributeList
public boolean isDeclared(String qName)
- Specified by:
- isDeclared in interface Attributes2
- Returns:
- false unless the attribute was declared in the DTD.
public boolean isDeclared(String uri, String localName)
- Specified by:
- isDeclared in interface Attributes2
- Returns:
- false unless the attribute was declared in the DTD.
public boolean isDeclared(int index)
- Specified by:
- isDeclared in interface Attributes2
- Returns:
- false unless the attribute was declared in the DTD.
public boolean isSpecified(String xmlName)
SAX-ext Attributes2 method (don't invoke on parser);
- Specified by:
- isSpecified in interface Attributes2
public boolean isSpecified(String uri, String local)
SAX-ext Attributes2 method (don't invoke on parser);
- Specified by:
- isSpecified in interface Attributes2
public boolean isSpecified(int index)
SAX-ext Attributes2 method (don't invoke on parser);
- Specified by:
- isSpecified in interface Attributes2
public void parse(String systemId) throws SAXException, IOException
SAX1, SAX2: Preferred API to parse an XML document, using a system identifier (URI).
public void parse(InputSource source) throws SAXException, IOException
SAX1, SAX2: Auxiliary API to parse an XML document, used mostly when no URI is available. If you want anything useful to happen, you should set at least one type of handler.
- Parameters:
source
- The XML input source. Don't set 'encoding' unless you know for a fact that it's correct.
- Throws:
SAXException
- The handlers may throw any SAXException, and the parser normally throws SAXParseException objects.
public void setContentHandler(ContentHandler handler)
SAX2: Assigns the object used to report the logical content of an XML document. If a document handler was set, this content handler will supplant it (but XML 1.0 style name reporting may remain enabled).
- Specified by:
- setContentHandler in interface XMLReader
public void setDTDHandler(DTDHandler handler)
SAX1, SAX2: Set the DTD handler for this parser.
- Specified by:
- setDTDHandler in interface XMLReader
- setDTDHandler in interface Parser
- Parameters:
handler
- The object to receive DTD events.
public void setDocumentHandler(DocumentHandler handler)
Deprecated. SAX2 programs should use the XMLReader interface and a ContentHandler.
SAX1: Set the document handler for this parser. If a content handler was set, this document handler will supplant it. The parser is set to report all XML 1.0 names rather than to filter out "xmlns" attributes (the "namespace-prefixes" feature is set to true).
- Specified by:
- setDocumentHandler in interface Parser
- Parameters:
handler
- The object to receive document events.
public void setEntityResolver(EntityResolver resolver)
SAX1, SAX2: Set the entity resolver for this parser.
- Specified by:
- setEntityResolver in interface XMLReader
- setEntityResolver in interface Parser
- Parameters:
public void setErrorHandler(ErrorHandler handler)
SAX1, SAX2: Set the error handler for this parser.
- Specified by:
- setErrorHandler in interface XMLReader
- setErrorHandler in interface Parser
- Parameters:
handler
- The object to receive error events.
public void setFeature(String featureId, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
SAX2: Sets the state of feature flags in this parser. Some built-in feature flags are mutable.
- Specified by:
- setFeature in interface XMLReader
public void setLocale(Locale locale) throws SAXException
SAX1: Sets the locale used for diagnostics; currently, only locales using the English language are supported.
- Parameters:
locale
- The locale for which diagnostics will be generated
public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
SAX2: Assigns the specified property. Like SAX1 handlers, these may be changed at any time.
- Specified by:
- setProperty in interface XMLReader