Package net.n3.nanoxml.sax
Class SAXParser
- java.lang.Object
-
- net.n3.nanoxml.sax.SAXParser
-
-
Constructor Summary
Constructors Constructor Description SAXParser()Creates the SAX parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinalize()Cleans up the object when it's destroyed.voidparse(String systemId)Parse an XML document from a system identifier (URI).voidparse(InputSource source)Parse an XML document.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.
-
-
-
Method Detail
-
finalize
protected void finalize() throws ThrowableCleans up the object when it's destroyed.
-
setLocale
public void setLocale(Locale locale) throws SAXException
Sets the locale. Only locales using the language english are accepted.- Specified by:
setLocalein interfaceParser- Parameters:
locale- the locale- Throws:
SAXException- iflocaleisnullor the associated language is not english.
-
setEntityResolver
public void setEntityResolver(EntityResolver resolver)
Sets the entity resolver.- Specified by:
setEntityResolverin interfaceParser- Parameters:
resolver- the entity resolver
-
setDTDHandler
public void setDTDHandler(DTDHandler handler)
Sets the DTD handler. As the parser is non-validating, this handler is never called.- Specified by:
setDTDHandlerin interfaceParser- Parameters:
handler- the DTD handler
-
setDocumentHandler
public void setDocumentHandler(DocumentHandler handler)
Allows an application to register a document event handler.- Specified by:
setDocumentHandlerin interfaceParser- Parameters:
handler- the document handler
-
setErrorHandler
public void setErrorHandler(ErrorHandler handler)
Allow an application to register an error event handler.- Specified by:
setErrorHandlerin interfaceParser- Parameters:
handler- the error handler
-
parse
public void parse(InputSource source) throws SAXException, IOException
Parse an XML document.- Specified by:
parsein interfaceParser- Parameters:
source- the input source- Throws:
SAXExceptionIOException
-
parse
public void parse(String systemId) throws SAXException, IOException
Parse an XML document from a system identifier (URI).- Specified by:
parsein interfaceParser- Parameters:
systemId- the system ID- Throws:
SAXExceptionIOException
-
-