Android
javax.xml.parsers
public abstract class

javax.xml.parsers.SAXParser

java.lang.Object
javax.xml.parsers.SAXParser

Provides a wrapper around a SAX XMLReader. This abstract class only defines the interface, whereas the SAXParserFactory class is used to obtain instances of concrete subclasses.

Summary

Protected Constructors

            SAXParser()
Do-nothing constructor.

Public Methods

abstract          Parser  getParser()
Queries the underlying SAX Parser object.
abstract          Object  getProperty(String name)
Queries a property of the underlying SAX XMLReader.
abstract          XMLReader  getXMLReader()
Queries the underlying SAX XMLReader object.
abstract          boolean  isNamespaceAware()
Reflects whether this SAXParser is namespace-aware.
abstract          boolean  isValidating()
Reflects whether this SAXParser is validating.
          boolean  isXIncludeAware()
Reflects whether this SAXParser is XInclude-aware.
          void  parse(InputStream stream, DefaultHandler handler)
Parses the given XML InputStream using the given SAX event handler.
          void  parse(InputStream stream, HandlerBase handler)
Parses the given XML InputStream using the given SAX event handler.
          void  parse(String uri, HandlerBase handler)
Parses the contents of the given URI using the given SAX event handler.
          void  parse(InputStream stream, DefaultHandler handler, String systemId)
Parses the given XML InputStream using the given SAX event handler and system ID.
          void  parse(InputStream stream, HandlerBase handler, String systemId)
Parses the given XML InputStream using the given SAX event handler and system ID.
          void  parse(InputSource source, DefaultHandler handler)
Parses the given SAX InputSource using the given SAX event handler.
          void  parse(InputSource source, HandlerBase handler)
Parses the given SAX InputSource using the given SAX event handler.
          void  parse(String uri, DefaultHandler handler)
Parses the contents of the given URI using the given SAX event handler.
          void  parse(File file, DefaultHandler handler)
Parses the given XML file using the given SAX event handler.
          void  parse(File file, HandlerBase handler)
Parses the given XML file using the given SAX event handler.
          void  reset()
Resets the DocumentBuilder to the same state is was in after its creation.
abstract          void  setProperty(String name, Object value)
Sets a property of the underlying SAX XMLReader.
Methods inherited from class java.lang.Object

Details

Protected Constructors

protected SAXParser()

Do-nothing constructor. Prevents instantiation. To be overridden by concrete subclasses.

Public Methods

public abstract Parser getParser()

Queries the underlying SAX Parser object.

Returns

  • The SAX Parser.

Throws

SAXException if a problem occurs.

public abstract Object getProperty(String name)

Queries a property of the underlying SAX XMLReader.

Parameters

name The name of the property.

Returns

  • The value of the property.

Throws

SAXNotRecognizedException If the property is not known to the underlying SAX XMLReader.
SAXNotSupportedException If the property is known, but not supported by the underlying SAX XMLReader.

public abstract XMLReader getXMLReader()

Queries the underlying SAX XMLReader object.

Returns

  • The SAX XMLREader.

Throws

SAXException if a problem occurs.

public abstract boolean isNamespaceAware()

Reflects whether this SAXParser is namespace-aware.

Returns

  • true if the SAXParser is namespace-aware, or false otherwise.

public abstract boolean isValidating()

Reflects whether this SAXParser is validating.

Returns

  • true if the SAXParser is validating, or false otherwise.

public boolean isXIncludeAware()

Reflects whether this SAXParser is XInclude-aware.

Returns

  • true if the SAXParser is XInclude-aware, or false otherwise.

Throws

UnsupportedOperationException if the underlying implementation doesn't know about XInclude at all (backwards compatibility).

public void parse(InputStream stream, DefaultHandler handler)

Parses the given XML InputStream using the given SAX event handler.

Parameters

stream The InputStream.
handler The SAX handler.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void parse(InputStream stream, HandlerBase handler)

Parses the given XML InputStream using the given SAX event handler.

Parameters

stream The InputStream.
handler The SAX handler.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void parse(String uri, HandlerBase handler)

Parses the contents of the given URI using the given SAX event handler.

Parameters

uri The URI.
handler The SAX handler.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void parse(InputStream stream, DefaultHandler handler, String systemId)

Parses the given XML InputStream using the given SAX event handler and system ID.

Parameters

stream The InputStream.
handler The SAX handler.
systemId The system ID.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void parse(InputStream stream, HandlerBase handler, String systemId)

Parses the given XML InputStream using the given SAX event handler and system ID.

Parameters

stream The InputStream.
handler The SAX handler.
systemId The system ID.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void parse(InputSource source, DefaultHandler handler)

Parses the given SAX InputSource using the given SAX event handler.

Parameters

source The SAX HandlerBase.
handler The SAX handler.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void parse(InputSource source, HandlerBase handler)

Parses the given SAX InputSource using the given SAX event handler.

Parameters

source The SAX InputSource.
handler The SAX handler.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void parse(String uri, DefaultHandler handler)

Parses the contents of the given URI using the given SAX event handler.

Parameters

uri The URI.
handler The SAX handler.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void parse(File file, DefaultHandler handler)

Parses the given XML file using the given SAX event handler.

Parameters

file The file.
handler The SAX handler.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void parse(File file, HandlerBase handler)

Parses the given XML file using the given SAX event handler.

Parameters

file The file.
handler The SAX handler.

Throws

SAXException If a problem occurs during SAX parsing.
IOException If a general IO problem occurs.

public void reset()

Resets the DocumentBuilder to the same state is was in after its creation.

public abstract void setProperty(String name, Object value)

Sets a property of the underlying SAX XMLReader.

Parameters

name The name of the property.
value The value of the property.

Throws

SAXNotRecognizedException If the property is not known to the underlying SAX XMLReader.
SAXNotSupportedException If the property is known, but not supported by the underlying SAX XMLReader.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48