FileDocCategorySizeDatePackage
SAXParser.javaAPI DocphoneME MR2 API (J2ME)3963Wed May 02 18:00:34 BST 2007javax.xml.parsers

SAXParser

public abstract class SAXParser extends Object
Defines the API that represents a simple SAX parser. An instance of this class can be obtained from the {@link javax.xml.parsers.SAXParserFactory#newSAXParser()} method. Once an instance of this class is obtained, XML can be parsed from an InputStream

As the content is parsed by the underlying parser, methods of the given {@link org.xml.sax.helpers.DefaultHandler} are called.

An implementation of SAXParser is NOT guaranteed to behave as per the specification if it is used concurrently by two or more threads. It is recommended to have one instance of the SAXParser per thread or it is upto the application to make sure about the use of SAXParser from more than one thread.

since
JAXP 1.0
version
1.0

Fields Summary
Constructors Summary
protected SAXParser()

    
Methods Summary
public abstract booleanisNamespaceAware()
Indicates whether or not this parser is configured to understand namespaces.

return
true if this parser is configured to understand namespaces; false otherwise.

public abstract booleanisValidating()
Indicates whether or not this parser is configured to validate XML documents.

return
true if this parser is configured to validate XML documents; false otherwise.

public abstract voidparse(java.io.InputStream is, org.xml.sax.helpers.DefaultHandler dh)
Parse the content of the given {@link java.io.InputStream} instance as XML using the specified {@link org.xml.sax.helpers.DefaultHandler}.

param
is InputStream containing the content to be parsed.
param
dh The SAX DefaultHandler to use.
exception
IOException If any IO errors occur.
exception
IllegalArgumentException If the given InputStream is null.
exception
SAXException If the underlying parser throws a SAXException while parsing.

public abstract voidparse(org.xml.sax.InputSource is, org.xml.sax.helpers.DefaultHandler dh)
Parse the content given {@link org.xml.sax.InputSource} as XML using the specified {@link org.xml.sax.helpers.DefaultHandler}.

param
is The InputSource containing the content to be parsed.
param
dh The SAX DefaultHandler to use.
exception
IOException If any IO errors occur.
exception
IllegalArgumentException If the InputSource is null.
exception
SAXException If the underlying parser throws a SAXException while parsing.
see
org.xml.sax.DocumentHandler