Package net.n3.nanoxml.sax
Class SAXParser
- java.lang.Object
-
- net.n3.nanoxml.sax.SAXParser
-
- All Implemented Interfaces:
org.xml.sax.Parser
public class SAXParser extends java.lang.Object implements org.xml.sax.Parser
SAXParser implements the SAX Parser interface. It is the frontend to SAX for the NanoXML parser.- Author:
- Marc De Scheemaecker
-
-
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(java.lang.String systemId)
Parse an XML document from a system identifier (URI).void
parse(org.xml.sax.InputSource source)
Parse an XML document.void
setDocumentHandler(org.xml.sax.DocumentHandler handler)
Allows an application to register a document event handler.void
setDTDHandler(org.xml.sax.DTDHandler handler)
Sets the DTD handler.void
setEntityResolver(org.xml.sax.EntityResolver resolver)
Sets the entity resolver.void
setErrorHandler(org.xml.sax.ErrorHandler handler)
Allow an application to register an error event handler.void
setLocale(java.util.Locale locale)
Sets the locale.
-
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable
Cleans up the object when it's destroyed.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
setLocale
public void setLocale(java.util.Locale locale) throws org.xml.sax.SAXException
Sets the locale. Only locales using the language english are accepted.- Specified by:
setLocale
in interfaceorg.xml.sax.Parser
- Parameters:
locale
- the locale- Throws:
org.xml.sax.SAXException
- iflocale
isnull
or the associated language is not english.
-
setEntityResolver
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
Sets the entity resolver.- Specified by:
setEntityResolver
in interfaceorg.xml.sax.Parser
- Parameters:
resolver
- the entity resolver
-
setDTDHandler
public void setDTDHandler(org.xml.sax.DTDHandler handler)
Sets the DTD handler. As the parser is non-validating, this handler is never called.- Specified by:
setDTDHandler
in interfaceorg.xml.sax.Parser
- Parameters:
handler
- the DTD handler
-
setDocumentHandler
public void setDocumentHandler(org.xml.sax.DocumentHandler handler)
Allows an application to register a document event handler.- Specified by:
setDocumentHandler
in interfaceorg.xml.sax.Parser
- Parameters:
handler
- the document handler
-
setErrorHandler
public void setErrorHandler(org.xml.sax.ErrorHandler handler)
Allow an application to register an error event handler.- Specified by:
setErrorHandler
in interfaceorg.xml.sax.Parser
- Parameters:
handler
- the error handler
-
parse
public void parse(org.xml.sax.InputSource source) throws org.xml.sax.SAXException, java.io.IOException
Parse an XML document.- Specified by:
parse
in interfaceorg.xml.sax.Parser
- Parameters:
source
- the input source- Throws:
org.xml.sax.SAXException
java.io.IOException
-
parse
public void parse(java.lang.String systemId) throws org.xml.sax.SAXException, java.io.IOException
Parse an XML document from a system identifier (URI).- Specified by:
parse
in interfaceorg.xml.sax.Parser
- Parameters:
systemId
- the system ID- Throws:
org.xml.sax.SAXException
java.io.IOException
-
-