Class RejectingEntityDefaultHandler

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class RejectingEntityDefaultHandler
    extends org.xml.sax.helpers.DefaultHandler
    Default handler with special entity resolver that handles all entity resolution requests by returning an empty input source. This is to prevent "Arbitrary DTD inclusion in XML parsing".
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.xml.sax.InputSource resolveEntity​(java.lang.String publicId, java.lang.String systemId)  
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

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

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

      • RejectingEntityDefaultHandler

        public RejectingEntityDefaultHandler()
    • Method Detail

      • 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