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 void
finalize()
Cleans up the object when it's destroyed.void
parse(String systemId)
Parse an XML document from a system identifier (URI).void
parse(InputSource source)
Parse an XML document.void
setDocumentHandler(DocumentHandler handler)
Allows an application to register a document event handler.void
setDTDHandler(DTDHandler handler)
Sets the DTD handler.void
setEntityResolver(EntityResolver resolver)
Sets the entity resolver.void
setErrorHandler(ErrorHandler handler)
Allow an application to register an error event handler.void
setLocale(Locale locale)
Sets the locale.
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
Cleans 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:
setLocale
in interfaceParser
- Parameters:
locale
- the locale- Throws:
SAXException
- iflocale
isnull
or the associated language is not english.
-
setEntityResolver
public void setEntityResolver(EntityResolver resolver)
Sets the entity resolver.- Specified by:
setEntityResolver
in 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:
setDTDHandler
in interfaceParser
- Parameters:
handler
- the DTD handler
-
setDocumentHandler
public void setDocumentHandler(DocumentHandler handler)
Allows an application to register a document event handler.- Specified by:
setDocumentHandler
in interfaceParser
- Parameters:
handler
- the document handler
-
setErrorHandler
public void setErrorHandler(ErrorHandler handler)
Allow an application to register an error event handler.- Specified by:
setErrorHandler
in interfaceParser
- Parameters:
handler
- the error handler
-
parse
public void parse(InputSource source) throws SAXException, IOException
Parse an XML document.- Specified by:
parse
in interfaceParser
- Parameters:
source
- the input source- Throws:
SAXException
IOException
-
parse
public void parse(String systemId) throws SAXException, IOException
Parse an XML document from a system identifier (URI).- Specified by:
parse
in interfaceParser
- Parameters:
systemId
- the system ID- Throws:
SAXException
IOException
-
-