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

## javax.xml.parsers
Class SAXParser

    java.lang.Object
      |
      +--javax.xml.parsers.SAXParser

public abstract class SAXParser
extends java.lang.Object

Implementation instances of the `SAXParser` abstract class contain an implementation of the `org.xml.sax.Parser` interface and enables content from a variety of sources to be parsed using the contained parser.
Instances of `SAXParser` are obtained from a `SAXParserFactory` by invoking its `newSAXParser()` method.
ATTENTION: THIS IMPLEMENTATION OF THE "JAVAX.XML.PARSER" CLASSES IS NOT THE OFFICIAL REFERENCE IMPLEMENTATION OF THE JAVA SPECIFICATION REQUEST 5 FOUND AT http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING" SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT http://java.sun.com/xml
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version:
  1.0 CVS $Revision: 1.3 $ $Date: 2000/06/08 23:33:08 $

Constructor Summary
`protected` | `SAXParser()` Implementations should provide a protected constructor so that their factory implementation can instantiate instances of the implementation class.

Method Summary
`abstract Parser` | `getParser()` Returns the underlying `Parser` object which is wrapped by this `SAXParser` implementation.
`abstract boolean` | `isNamespaceAware()` Returns whether or not this parser supports XML namespaces.
`abstract boolean` | `isValidating()` Returns whether or not this parser supports validating XML content.
`void` | `parse(java.io.File file, HandlerBase base)` Parses the content of the given `File` as an XML document using the specified `HandlerBase` object.
`void` | `parse(InputSource source, HandlerBase base)` Parses the content of the given `InputSource` as an XML document using the specified `HandlerBase` object.
`void` | `parse(java.io.InputStream stream, HandlerBase base)` Parses the contents of the given `InputStream` as an XML document using the specified `HandlerBase` object.
`void` | `parse(java.lang.String uri, HandlerBase base)` Parses the content of the given URI as an XML document using the specified `HandlerBase` object.

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

Constructor Detail

### SAXParser

    protected SAXParser()

  Implementations should provide a protected constructor so that their factory implementation can instantiate instances of the implementation class.
  Application programmers should not be able to directly construct implementation subclasses of this abstract subclass. The only way a application should be able to obtain a reference to a SAXParser implementation instance is by using the appropriate methods of the `SAXParserFactory`.

Method Detail

### parse

    public void parse(java.io.InputStream stream,
                      HandlerBase base)
               throws SAXException,
                      java.io.IOException,
                      java.lang.IllegalArgumentException

  Parses the contents of the given `InputStream` as an XML document using the specified `HandlerBase` object.
  Throws:
    SAXException - If there is a problem parsing the given XML content.
    java.io.IOException - If any IO errors occur reading the given `InputStream`.
    java.lang.IllegalArgumentException - If the given `InputStream` is null.

### parse

    public void parse(java.lang.String uri,
                      HandlerBase base)
               throws SAXException,
                      java.io.IOException,
                      java.lang.IllegalArgumentException

  Parses the content of the given URI as an XML document using the specified `HandlerBase` object.
  Throws:
    SAXException - If there is a problem parsing the given XML content.
    java.io.IOException - If any IO errors occur while reading content located by the given URI.
    java.lang.IllegalArgumentException - If the given URI is null.

### parse

    public void parse(java.io.File file,
                      HandlerBase base)
               throws SAXException,
                      java.io.IOException,
                      java.lang.IllegalArgumentException

  Parses the content of the given `File` as an XML document using the specified `HandlerBase` object.
  Throws:
    SAXException - If there is a problem parsing the given XML content.
    java.io.IOException - if any IO errors occur while reading content from the given `File`.
    java.lang.IllegalArgumentException - if the given `File` is null.

### parse

    public void parse(InputSource source,
                      HandlerBase base)
               throws SAXException,
                      java.io.IOException,
                      java.lang.IllegalArgumentException

  Parses the content of the given `InputSource` as an XML document using the specified `HandlerBase` object.
  Throws:
    SAXException - If there is a problem parsing the given XML content.
    java.io.IOException - if any IO Errors occur while reading content from the given `InputSource`.
    java.lang.IllegalArgumentException - if the given `InputSource` is null.

### getParser

    public abstract Parser getParser()
                              throws SAXException

  Returns the underlying `Parser` object which is wrapped by this `SAXParser` implementation.
  Throws:
    SAXException - If the initialization of the underlying parser fails. NOTE: This Exception is specified on page 21 of the specification, but later on omissed in this method documentation on page 23. Wich one is correct?

### isNamespaceAware

    public abstract boolean isNamespaceAware()

  Returns whether or not this parser supports XML namespaces.

### isValidating

    public abstract boolean isValidating()

  Returns whether or not this parser supports validating XML content.

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