net.n3.nanoxml.sax

Class SAXParser

public class SAXParser extends Object implements Parser

SAXParser implements the SAX Parser interface. It is the frontend to SAX for the NanoXML parser.

Version: $Name: RELEASE_2_2_1 $, $Revision: 1.5 $

Author: Marc De Scheemaecker

Constructor Summary
SAXParser()
Creates the SAX parser.
Method Summary
protected voidfinalize()
Cleans up the object when it's destroyed.
voidparse(InputSource source)
Parse an XML document.
voidparse(String systemId)
Parse an XML document from a system identifier (URI).
voidsetDocumentHandler(DocumentHandler handler)
Allows an application to register a document event handler.
voidsetDTDHandler(DTDHandler handler)
Sets the DTD handler.
voidsetEntityResolver(EntityResolver resolver)
Sets the entity resolver.
voidsetErrorHandler(ErrorHandler handler)
Allow an application to register an error event handler.
voidsetLocale(Locale locale)
Sets the locale.

Constructor Detail

SAXParser

public SAXParser()
Creates the SAX parser.

Method Detail

finalize

protected void finalize()
Cleans up the object when it's destroyed.

parse

public void parse(InputSource source)
Parse an XML document.

Parameters: source the input source

parse

public void parse(String systemId)
Parse an XML document from a system identifier (URI).

Parameters: systemId the system ID

setDocumentHandler

public void setDocumentHandler(DocumentHandler handler)
Allows an application to register a document event handler.

Parameters: handler the document handler

setDTDHandler

public void setDTDHandler(DTDHandler handler)
Sets the DTD handler. As the parser is non-validating, this handler is never called.

Parameters: handler the DTD handler

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Sets the entity resolver.

Parameters: resolver the entity resolver

setErrorHandler

public void setErrorHandler(ErrorHandler handler)
Allow an application to register an error event handler.

Parameters: handler the error handler

setLocale

public void setLocale(Locale locale)
Sets the locale. Only locales using the language english are accepted.

Parameters: locale the locale

Throws: org.xml.sax.SAXException if locale is null or the associated language is not english.