Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
javax.xml.parsers

Class SAXParser

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


public abstract class SAXParser

extends Object

Wraps a SAX2 (or SAX1) parser.

Note that parsing with methods on this interface requires use of one of the optional SAX base classes. It's usually preferable to use the SAX parser APIs directly. SAX gives much more flexibility about how application classes are organized, and about how the document entity is packaged for delivery to the parser. And JAXP doesn't otherwise provide access to the SAX2 extension handlers for lexical or declaration events.

Authors:

Constructor Summary

SAXParser()

Only subclasses may use the constructor.

Method Summary

org.xml.sax.ParsergetParser()

Get a (deprecated) SAX1 driver for the underlying parser.
java.lang.ObjectgetProperty(java.lang.String id)

org.xml.sax.XMLReadergetXMLReader()

Get a SAX2 driver for the underlying parser.
booleanisNamespaceAware()

booleanisValidating()

voidparse(java.io.InputStream stream, org.xml.sax.HandlerBase handler)

Parse using (deprecated) SAX1 style handlers, and a byte stream (with no URI).
voidparse(java.io.InputStream stream, org.xml.sax.HandlerBase handler, java.lang.String systemID)

Parse using (deprecated) SAX1 style handlers, and a byte stream with a specified URI.
voidparse(java.io.InputStream stream, org.xml.sax.helpers.DefaultHandler def)

Parse using SAX2 style handlers, and a byte stream (with no URI).
voidparse(java.io.InputStream stream, org.xml.sax.helpers.DefaultHandler def, java.lang.String systemID)

Parse using SAX2 style handlers, and a byte stream with a specified URI.
voidparse(java.lang.String uri, org.xml.sax.HandlerBase handler)

Parse using (deprecated) SAX1 style handlers, and a URI for the document entity.
voidparse(java.lang.String uri, org.xml.sax.helpers.DefaultHandler def)

Parse using SAX2 style handlers, and a URI for the document entity.
voidparse(java.io.File file, org.xml.sax.HandlerBase handler)

Parse using (deprecated) SAX1 style handlers, turning a file name into the document URI.
voidparse(java.io.File file, org.xml.sax.helpers.DefaultHandler def)

Parse using SAX2 style handlers, turning a file name into the document URI.
voidparse(org.xml.sax.InputSource source, org.xml.sax.HandlerBase handler)

Parse using (deprecated) SAX1 style handlers.
voidparse(org.xml.sax.InputSource source, org.xml.sax.helpers.DefaultHandler def)

Parse using SAX2 style handlers.
voidsetProperty(java.lang.String id, java.lang.Object value)

Constructor Details

SAXParser

protected SAXParser()

Only subclasses may use the constructor.


Method Details

getParser

public Parser getParser()

Get a (deprecated) SAX1 driver for the underlying parser.


getProperty

public Object getProperty(java.lang.String id)

Parameters:


getXMLReader

public XMLReader getXMLReader()

Get a SAX2 driver for the underlying parser.


isNamespaceAware

public boolean isNamespaceAware()


isValidating

public boolean isValidating()


parse

public void parse(java.io.File file, org.xml.sax.HandlerBase handler)

Parse using (deprecated) SAX1 style handlers, turning a file name into the document URI.

Parameters:


parse

public void parse(java.io.File file, org.xml.sax.helpers.DefaultHandler def)

Parse using SAX2 style handlers, turning a file name into the document URI.

Parameters:


parse

public void parse(java.io.InputStream stream, org.xml.sax.HandlerBase handler)

Parse using (deprecated) SAX1 style handlers, and a byte stream (with no URI). Avoid using this API, since relative URIs in the document need to be resolved against the document entity's URI, and good diagnostics also need that URI.

Parameters:


parse

public void parse(java.io.InputStream stream, org.xml.sax.HandlerBase handler, java.lang.String systemID)

Parse using (deprecated) SAX1 style handlers, and a byte stream with a specified URI.

Parameters:


parse

public void parse(java.io.InputStream stream, org.xml.sax.helpers.DefaultHandler def)

Parse using SAX2 style handlers, and a byte stream (with no URI). Avoid using this API, since relative URIs in the document need to be resolved against the document entity's URI, and good diagnostics also need that URI.

Parameters:


parse

public void parse(java.io.InputStream stream, org.xml.sax.helpers.DefaultHandler def, java.lang.String systemID)

Parse using SAX2 style handlers, and a byte stream with a specified URI.

Parameters:


parse

public void parse(java.lang.String uri, org.xml.sax.HandlerBase handler)

Parse using (deprecated) SAX1 style handlers, and a URI for the document entity.

Parameters:


parse

public void parse(java.lang.String uri, org.xml.sax.helpers.DefaultHandler def)

Parse using SAX2 style handlers, and a URI for the document entity.

Parameters:


parse

public void parse(org.xml.sax.InputSource source, org.xml.sax.HandlerBase handler)

Parse using (deprecated) SAX1 style handlers.

Parameters:


parse

public void parse(org.xml.sax.InputSource source, org.xml.sax.helpers.DefaultHandler def)

Parse using SAX2 style handlers.

Parameters:


setProperty

public void setProperty(java.lang.String id, java.lang.Object value)

Parameters: