Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gnu.xml.aelfred2
Class SAXDriver

    java.lang.Object
      |
      +--gnu.xml.aelfred2.SAXDriver

All Implemented Interfaces:
  AttributeList, Attributes, Attributes2, Locator, Parser, XMLReader

public final class SAXDriver
extends java.lang.Object
implements Locator, Attributes2, XMLReader, Parser, AttributeList

An enhanced SAX2 version of Microstar's Ælfred XML parser. The enhancements primarily relate to significant improvements in conformance to the XML specification, and SAX2 support. Performance has been improved. See the package level documentation for more information.

Name | Notes
--- | ---
Features ... URL prefix is http://xml.org/sax/features/
(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
Handler Properties ... URL prefix is http://xml.org/sax/properties/
(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.

Version:
  $Date: 2001/11/19 18:27:20 $
Author:
  Written by David Megginson (version 1.2a from Microstar), Updated by David Brownell <dbrownell@users.sourceforge.net>
See Also:
  `Parser`

Constructor Summary
`SAXDriver()` Constructs a SAX Parser.

Method Summary
`int` | `getColumnNumber()` SAX Locator method (don't invoke on parser);
`ContentHandler` | `getContentHandler()` SAX2: Returns the object used to report the logical content of an XML document.
`DTDHandler` | `getDTDHandler()` SAX2: Returns the object used to process declarations related to notations and unparsed entities.
`EntityResolver` | `getEntityResolver()` SAX2: Returns the object used when resolving external entities during parsing (both general and parameter entities).
`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 i)` 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 i)` 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 i)` 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 i)` 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);
`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` | `parse(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` | `setContentHandler(ContentHandler handler)` SAX2: Assigns the object used to report the logical content of an XML document.
`void` | `setDocumentHandler(DocumentHandler handler)` Deprecated. SAX2 programs should use the XMLReader interface and a ContentHandler.
`void` | `setDTDHandler(DTDHandler handler)` SAX1, SAX2: Set the DTD handler for this parser.
`void` | `setEntityResolver(EntityResolver resolver)` SAX1, SAX2: Set the entity resolver for this parser.
`void` | `setErrorHandler(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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SAXDriver

    public SAXDriver()

  Constructs a SAX Parser.

Method Detail

### setLocale

    public void setLocale(java.util.Locale locale)
                   throws SAXException

  SAX1: Sets the locale used for diagnostics; currently, only locales using the English language are supported.
  Specified by:
    `setLocale` in interface `Parser`
  Parameters:
    `locale` - The locale for which diagnostics will be generated

### getEntityResolver

    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`
  Following copied from interface: `org.xml.sax.XMLReader`
  Returns:
    The current entity resolver, or null if none has been registered.
  See Also:
    `XMLReader.setEntityResolver(org.xml.sax.EntityResolver)`

### setEntityResolver

    public void setEntityResolver(EntityResolver resolver)

  SAX1, SAX2: Set the entity resolver for this parser.
  Specified by:
    `setEntityResolver` in interface `XMLReader`
  Parameters:
    `handler` - The object to receive entity events.

### getDTDHandler

    public DTDHandler getDTDHandler()

  SAX2: Returns the object used to process declarations related to notations and unparsed entities.
  Specified by:
    `getDTDHandler` in interface `XMLReader`
  Following copied from interface: `org.xml.sax.XMLReader`
  Returns:
    The current DTD handler, or null if none has been registered.
  See Also:
    `XMLReader.setDTDHandler(org.xml.sax.DTDHandler)`

### setDTDHandler

    public void setDTDHandler(DTDHandler handler)

  SAX1, SAX2: Set the DTD handler for this parser.
  Specified by:
    `setDTDHandler` in interface `XMLReader`
  Parameters:
    `handler` - The object to receive DTD events.

### setDocumentHandler

    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.

### getContentHandler

    public ContentHandler getContentHandler()

  SAX2: Returns the object used to report the logical content of an XML document.
  Specified by:
    `getContentHandler` in interface `XMLReader`
  Following copied from interface: `org.xml.sax.XMLReader`
  Returns:
    The current content handler, or null if none has been registered.
  See Also:
    `XMLReader.setContentHandler(org.xml.sax.ContentHandler)`

### setContentHandler

    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`
  Following copied from interface: `org.xml.sax.XMLReader`
  Parameters:
    `handler` - The content handler.
  See Also:
    `XMLReader.getContentHandler()`

### setErrorHandler

    public void setErrorHandler(ErrorHandler handler)

  SAX1, SAX2: Set the error handler for this parser.
  Specified by:
    `setErrorHandler` in interface `XMLReader`
  Parameters:
    `handler` - The object to receive error events.

### getErrorHandler

    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`
  Following copied from interface: `org.xml.sax.XMLReader`
  Returns:
    The current error handler, or null if none has been registered.
  See Also:
    `XMLReader.setErrorHandler(org.xml.sax.ErrorHandler)`

### parse

    public void parse(InputSource source)
               throws SAXException,
                      java.io.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.
  Specified by:
    `parse` in interface `XMLReader`
  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.
    `java.io.IOException` - IOExceptions are normally through through the parser if there are problems reading the source document.
  See Also:
    `setEntityResolver(org.xml.sax.EntityResolver)`, `setDTDHandler(org.xml.sax.DTDHandler)`, `setContentHandler(org.xml.sax.ContentHandler)`, `setErrorHandler(org.xml.sax.ErrorHandler)`

### parse

    public void parse(java.lang.String systemId)
               throws SAXException,
                      java.io.IOException

  SAX1, SAX2: Preferred API to parse an XML document, using a system identifier (URI).
  Specified by:
    `parse` in interface `XMLReader`
  Following copied from interface: `org.xml.sax.XMLReader`
  Parameters:
    `systemId` - The system identifier (URI).
  Throws:
    `SAXException` - Any SAX exception, possibly wrapping another exception.
    `java.io.IOException` - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
  See Also:
    `XMLReader.parse(org.xml.sax.InputSource)`

### getFeature

    public boolean getFeature(java.lang.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.

### getProperty

    public java.lang.Object getProperty(java.lang.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.

### setFeature

    public void setFeature(java.lang.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`
  Following copied from interface: `org.xml.sax.XMLReader`
  Parameters:
    `name` - The feature name, which is a fully-qualified URI.
    `value` - The requested value of the feature (true or false).
  Throws:
    `SAXNotRecognizedException` - If the feature value can't be assigned or retrieved.
    `SAXNotSupportedException` - When the XMLReader recognizes the feature name but cannot set the requested value.
  See Also:
    `XMLReader.getFeature(java.lang.String)`

### setProperty

    public void setProperty(java.lang.String propertyId,
                            java.lang.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`
  Following copied from interface: `org.xml.sax.XMLReader`
  Parameters:
    `name` - The property name, which is a fully-qualified URI.
    `value` - The requested value for the property.
  Throws:
    `SAXNotRecognizedException` - If the property value can't be assigned or retrieved.
    `SAXNotSupportedException` - When the XMLReader recognizes the property name but cannot set the requested value.

### getLength

    public int getLength()

  SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getLength` in interface `Attributes`
  Following copied from interface: `org.xml.sax.AttributeList`
  Returns:
    The number of attributes in the list.

### getURI

    public java.lang.String getURI(int index)

  SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getURI` in interface `Attributes`
  Following copied from interface: `org.xml.sax.Attributes`
  Parameters:
    `index` - The attribute index (zero-based).
  Returns:
    The Namespace URI, or the empty string if none is available, or null if the index is out of range.
  See Also:
    `Attributes.getLength()`

### getLocalName

    public java.lang.String getLocalName(int index)

  SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getLocalName` in interface `Attributes`
  Following copied from interface: `org.xml.sax.Attributes`
  Parameters:
    `index` - The attribute index (zero-based).
  Returns:
    The local name, or the empty string if Namespace processing is not being performed, or null if the index is out of range.
  See Also:
    `Attributes.getLength()`

### getQName

    public java.lang.String getQName(int i)

  SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getQName` in interface `Attributes`
  Following copied from interface: `org.xml.sax.Attributes`
  Parameters:
    `index` - The attribute index (zero-based).
  Returns:
    The XML 1.0 qualified name, or the empty string if none is available, or null if the index is out of range.
  See Also:
    `Attributes.getLength()`

### getName

    public java.lang.String getName(int i)

  SAX1 AttributeList method (don't invoke on parser);
  Specified by:
    `getName` in interface `AttributeList`
  Following copied from interface: `org.xml.sax.AttributeList`
  Parameters:
    `i` - The index of the attribute in the list (starting at 0).
  Returns:
    The name of the indexed attribute, or null if the index is out of range.
  See Also:
    `AttributeList.getLength()`

### getType

    public java.lang.String getType(int i)

  SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getType` in interface `Attributes`
  Following copied from interface: `org.xml.sax.AttributeList`
  Parameters:
    `i` - The index of the attribute in the list (starting at 0).
  Returns:
    The attribute type as a string, or null if the index is out of range.
  See Also:
    `AttributeList.getLength()`, `AttributeList.getType(java.lang.String)`

### getValue

    public java.lang.String getValue(int i)

  SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getValue` in interface `Attributes`
  Following copied from interface: `org.xml.sax.AttributeList`
  Parameters:
    `i` - The index of the attribute in the list (starting at 0).
  Returns:
    The attribute value as a string, or null if the index is out of range.
  See Also:
    `AttributeList.getLength()`, `AttributeList.getValue(java.lang.String)`

### getIndex

    public int getIndex(java.lang.String uri,
                        java.lang.String local)

  SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getIndex` in interface `Attributes`
  Following copied from interface: `org.xml.sax.Attributes`
  Parameters:
    `uri` - The Namespace URI, or the empty string if the name has no Namespace URI.
    `localName` - The attribute's local name.
  Returns:
    The index of the attribute, or -1 if it does not appear in the list.

### getIndex

    public int getIndex(java.lang.String xmlName)

  SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getIndex` in interface `Attributes`
  Following copied from interface: `org.xml.sax.Attributes`
  Parameters:
    `qName` - The qualified (prefixed) name.
  Returns:
    The index of the attribute, or -1 if it does not appear in the list.

### getType

    public java.lang.String getType(java.lang.String uri,
                                    java.lang.String local)

  SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getType` in interface `Attributes`
  Following copied from interface: `org.xml.sax.Attributes`
  Parameters:
    `uri` - The Namespace URI, or the empty String if the name has no Namespace URI.
    `localName` - The local name of the attribute.
  Returns:
    The attribute type as a string, or null if the attribute is not in the list or if Namespace processing is not being performed.

### getType

    public java.lang.String getType(java.lang.String xmlName)

  SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getType` in interface `Attributes`
  Following copied from interface: `org.xml.sax.AttributeList`
  Parameters:
    `name` - The name of the attribute.
  Returns:
    The attribute type as a string, or null if no such attribute exists.
  See Also:
    `AttributeList.getType(int)`

### getValue

    public java.lang.String getValue(java.lang.String uri,
                                     java.lang.String local)

  SAX Attributes method (don't invoke on parser);
  Specified by:
    `getValue` in interface `Attributes`
  Following copied from interface: `org.xml.sax.Attributes`
  Parameters:
    `uri` - The Namespace URI, or the empty String if the name has no Namespace URI.
    `localName` - The local name of the attribute.
  Returns:
    The attribute value as a string, or null if the attribute is not in the list.

### getValue

    public java.lang.String getValue(java.lang.String xmlName)

  SAX1 AttributeList, SAX2 Attributes method (don't invoke on parser);
  Specified by:
    `getValue` in interface `Attributes`
  Following copied from interface: `org.xml.sax.AttributeList`
  Parameters:
    `i` - The index of the attribute in the list.
  Returns:
    The attribute value as a string, or null if no such attribute exists.
  See Also:
    `AttributeList.getValue(int)`

### isSpecified

    public boolean isSpecified(int index)

  SAX-ext Attributes2 method (don't invoke on parser);
  Specified by:
    `isSpecified` in interface `Attributes2`
  Following copied from interface: `org.xml.sax.ext.Attributes2`
  Parameters:
    `index` - The attribute index (zero-based).
  Returns:
    true if the value was found in the XML text, false if the value was provided by DTD defaulting.
  Throws:
    `java.lang.ArrayIndexOutOfBoundsException` - When the supplied index does not identify an attribute.

### isSpecified

    public boolean isSpecified(java.lang.String uri,
                               java.lang.String local)

  SAX-ext Attributes2 method (don't invoke on parser);
  Specified by:
    `isSpecified` in interface `Attributes2`
  Following copied from interface: `org.xml.sax.ext.Attributes2`
  Parameters:
    `uri` - The Namespace URI, or the empty string if the name has no Namespace URI.
    `localName` - The attribute's local name.
  Returns:
    true if the value was found in the XML text, false if the value was provided by DTD defaulting.
  Throws:
    `java.lang.IllegalArgumentException` - When the supplied names do not identify an attribute.

### isSpecified

    public boolean isSpecified(java.lang.String xmlName)

  SAX-ext Attributes2 method (don't invoke on parser);
  Specified by:
    `isSpecified` in interface `Attributes2`
  Following copied from interface: `org.xml.sax.ext.Attributes2`
  Parameters:
    `qName` - The XML 1.0 qualified name.
  Returns:
    true if the value was found in the XML text, false if the value was provided by DTD defaulting.
  Throws:
    `java.lang.IllegalArgumentException` - When the supplied name does not identify an attribute.

### getPublicId

    public java.lang.String getPublicId()

  SAX Locator method (don't invoke on parser);
  Specified by:
    `getPublicId` in interface `Locator`
  Following copied from interface: `org.xml.sax.Locator`
  Returns:
    A string containing the public identifier, or null if none is available.
  See Also:
    `Locator.getSystemId()`

### getSystemId

    public java.lang.String getSystemId()

  SAX Locator method (don't invoke on parser);
  Specified by:
    `getSystemId` in interface `Locator`
  Following copied from interface: `org.xml.sax.Locator`
  Returns:
    A string containing the system identifier, or null if none is available.
  See Also:
    `Locator.getPublicId()`

### getLineNumber

    public int getLineNumber()

  SAX Locator method (don't invoke on parser);
  Specified by:
    `getLineNumber` in interface `Locator`
  Following copied from interface: `org.xml.sax.Locator`
  Returns:
    The line number, or -1 if none is available.
  See Also:
    `Locator.getColumnNumber()`

### getColumnNumber

    public int getColumnNumber()

  SAX Locator method (don't invoke on parser);
  Specified by:
    `getColumnNumber` in interface `Locator`
  Following copied from interface: `org.xml.sax.Locator`
  Returns:
    The column number, or -1 if none is available.
  See Also:
    `Locator.getLineNumber()`

Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Source code is under GPL (with library exception) in the JAXP project at http://www.gnu.org/software/classpathx/jaxp
This documentation was derived from that source code on 2001-11-20.