Build 1.0_r1(from source)

javax.xml.parsers
Class SAXParser

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

public abstract class SAXParser
extends Object

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.


Constructor Summary
protected SAXParser()
          Do-nothing constructor.
 
Method Summary
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(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 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(InputStream stream, DefaultHandler handler)
          Parses the given XML InputStream 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)
          Parses the given XML InputStream using the given SAX event handler.
 void parse(InputStream stream, HandlerBase handler, String systemId)
          Parses the given XML InputStream using the given SAX event handler and system ID.
 void parse(String uri, DefaultHandler handler)
          Parses the contents of the given URI 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 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXParser

protected SAXParser()
Do-nothing constructor. Prevents instantiation. To be overridden by concrete subclasses.

Method Detail

getParser

public abstract Parser getParser()
                          throws SAXException
Queries the underlying SAX Parser object.

Returns:
The SAX Parser.
Throws:
SAXException - if a problem occurs.

getProperty

public abstract Object getProperty(String name)
                            throws SAXNotRecognizedException,
                                   SAXNotSupportedException
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.

getXMLReader

public abstract XMLReader getXMLReader()
                                throws SAXException
Queries the underlying SAX XMLReader object.

Returns:
The SAX XMLREader.
Throws:
SAXException - if a problem occurs.

isNamespaceAware

public abstract boolean isNamespaceAware()
Reflects whether this SAXParser is namespace-aware.

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

isValidating

public abstract boolean isValidating()
Reflects whether this SAXParser is validating.

Returns:
true if the SAXParser is validating, or false otherwise.

isXIncludeAware

public boolean isXIncludeAware()
                        throws UnsupportedOperationException
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).

parse

public void parse(File file,
                  HandlerBase handler)
           throws SAXException,
                  IOException
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.

parse

public void parse(File file,
                  DefaultHandler handler)
           throws SAXException,
                  IOException
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.

parse

public void parse(InputStream stream,
                  HandlerBase handler)
           throws SAXException,
                  IOException
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.

parse

public void parse(InputStream stream,
                  HandlerBase handler,
                  String systemId)
           throws SAXException,
                  IOException
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.

parse

public void parse(InputStream stream,
                  DefaultHandler handler)
           throws SAXException,
                  IOException
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.

parse

public void parse(InputStream stream,
                  DefaultHandler handler,
                  String systemId)
           throws SAXException,
                  IOException
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.

parse

public void parse(String uri,
                  HandlerBase handler)
           throws SAXException,
                  IOException
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.

parse

public void parse(String uri,
                  DefaultHandler handler)
           throws SAXException,
                  IOException
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.

parse

public void parse(InputSource source,
                  HandlerBase handler)
           throws SAXException,
                  IOException
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.

parse

public void parse(InputSource source,
                  DefaultHandler handler)
           throws SAXException,
                  IOException
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.

reset

public void reset()
Resets the DocumentBuilder to the same state is was in after its creation.


setProperty

public abstract void setProperty(String name,
                                 Object value)
                          throws SAXNotRecognizedException,
                                 SAXNotSupportedException
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.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature