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.ParserSAXParser 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 voidfinalize()Cleans up the object when it's destroyed.voidparse(java.lang.String systemId)Parse an XML document from a system identifier (URI).voidparse(org.xml.sax.InputSource source)Parse an XML document.voidsetDocumentHandler(org.xml.sax.DocumentHandler handler)Allows an application to register a document event handler.voidsetDTDHandler(org.xml.sax.DTDHandler handler)Sets the DTD handler.voidsetEntityResolver(org.xml.sax.EntityResolver resolver)Sets the entity resolver.voidsetErrorHandler(org.xml.sax.ErrorHandler handler)Allow an application to register an error event handler.voidsetLocale(java.util.Locale locale)Sets the locale.
-
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.ThrowableCleans up the object when it's destroyed.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
setLocale
public void setLocale(java.util.Locale locale) throws org.xml.sax.SAXExceptionSets the locale. Only locales using the language english are accepted.- Specified by:
setLocalein interfaceorg.xml.sax.Parser- Parameters:
locale- the locale- Throws:
org.xml.sax.SAXException- iflocaleisnullor the associated language is not english.
-
setEntityResolver
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
Sets the entity resolver.- Specified by:
setEntityResolverin 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:
setDTDHandlerin 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:
setDocumentHandlerin 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:
setErrorHandlerin 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.IOExceptionParse an XML document.- Specified by:
parsein interfaceorg.xml.sax.Parser- Parameters:
source- the input source- Throws:
org.xml.sax.SAXExceptionjava.io.IOException
-
parse
public void parse(java.lang.String systemId) throws org.xml.sax.SAXException, java.io.IOExceptionParse an XML document from a system identifier (URI).- Specified by:
parsein interfaceorg.xml.sax.Parser- Parameters:
systemId- the system ID- Throws:
org.xml.sax.SAXExceptionjava.io.IOException
-
-