Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SAXParser

        public SAXParser()
        Creates the SAX parser.
    • Method Detail

      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Cleans up the object when it's destroyed.
        Overrides:
        finalize in class java.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 interface org.xml.sax.Parser
        Parameters:
        locale - the locale
        Throws:
        org.xml.sax.SAXException - if locale is null or the associated language is not english.
      • setEntityResolver

        public void setEntityResolver​(org.xml.sax.EntityResolver resolver)
        Sets the entity resolver.
        Specified by:
        setEntityResolver in interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.xml.sax.Parser
        Parameters:
        systemId - the system ID
        Throws:
        org.xml.sax.SAXException
        java.io.IOException