Class DefaultSaxHandler

  • All Implemented Interfaces:
    org.w3c.dom.ls.LSResourceResolver, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class DefaultSaxHandler
    extends org.xml.sax.helpers.DefaultHandler
    implements org.w3c.dom.ls.LSResourceResolver
    A Utility class which extends the provided DefaultHandler and implements the LSResourceResolver interface. All the methods of this class do nothing besides generating log messages.
    Author:
    Raif S. Naffah, Jerome Louvel
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultSaxHandler()
      Trivial constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void error​(org.xml.sax.SAXParseException x)  
      void fatalError​(org.xml.sax.SAXParseException x)  
      org.xml.sax.InputSource resolveEntity​(java.lang.String publicId, java.lang.String systemId)  
      org.w3c.dom.ls.LSInput resolveResource​(java.lang.String type, java.lang.String namespaceUri, java.lang.String publicId, java.lang.String systemId, java.lang.String baseUri)
      Allow the application to resolve external resources.
      void skippedEntity​(java.lang.String name)  
      void warning​(org.xml.sax.SAXParseException x)  
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

        characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, startDocument, startElement, startPrefixMapping, unparsedEntityDecl
      • Methods inherited from class java.lang.Object

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

      • DefaultSaxHandler

        public DefaultSaxHandler()
        Trivial constructor.
    • Method Detail

      • error

        public void error​(org.xml.sax.SAXParseException x)
                   throws org.xml.sax.SAXException
        Specified by:
        error in interface org.xml.sax.ErrorHandler
        Overrides:
        error in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • fatalError

        public void fatalError​(org.xml.sax.SAXParseException x)
                        throws org.xml.sax.SAXException
        Specified by:
        fatalError in interface org.xml.sax.ErrorHandler
        Overrides:
        fatalError in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • resolveEntity

        public org.xml.sax.InputSource resolveEntity​(java.lang.String publicId,
                                                     java.lang.String systemId)
                                              throws java.io.IOException,
                                                     org.xml.sax.SAXException
        Specified by:
        resolveEntity in interface org.xml.sax.EntityResolver
        Overrides:
        resolveEntity in class org.xml.sax.helpers.DefaultHandler
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • resolveResource

        public org.w3c.dom.ls.LSInput resolveResource​(java.lang.String type,
                                                      java.lang.String namespaceUri,
                                                      java.lang.String publicId,
                                                      java.lang.String systemId,
                                                      java.lang.String baseUri)
        Allow the application to resolve external resources.

        This implementation always returns a null.

        Specified by:
        resolveResource in interface org.w3c.dom.ls.LSResourceResolver
        Parameters:
        type - The type of the resource being resolved.
        namespaceUri - The namespace of the resource being resolved.
        publicId - The public identifier.
        systemId - The system identifier.
        baseUri - The absolute base URI of the resource being parsed.
        Returns:
        Always null.
      • skippedEntity

        public void skippedEntity​(java.lang.String name)
                           throws org.xml.sax.SAXException
        Specified by:
        skippedEntity in interface org.xml.sax.ContentHandler
        Overrides:
        skippedEntity in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException
      • warning

        public void warning​(org.xml.sax.SAXParseException x)
                     throws org.xml.sax.SAXException
        Specified by:
        warning in interface org.xml.sax.ErrorHandler
        Overrides:
        warning in class org.xml.sax.helpers.DefaultHandler
        Throws:
        org.xml.sax.SAXException