Class ChainedEntityResolver

  • All Implemented Interfaces:
    org.xml.sax.EntityResolver, org.xml.sax.ext.EntityResolver2

    public class ChainedEntityResolver
    extends java.lang.Object
    implements org.xml.sax.ext.EntityResolver2
    An EntityResolver that first tries one supplied EntityResolver, and if that returns null, falls back to another. Either EntityResolver may itself be a ChainedEntityResolver, so a chain of any length can be established.
    Since:
    11.1
    • Constructor Summary

      Constructors 
      Constructor Description
      ChainedEntityResolver​(org.xml.sax.EntityResolver first, org.xml.sax.EntityResolver second)
      Create a composite entity resolver
    • Method Summary

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

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

      • ChainedEntityResolver

        public ChainedEntityResolver​(org.xml.sax.EntityResolver first,
                                     org.xml.sax.EntityResolver second)
        Create a composite entity resolver
        Parameters:
        first - the first entity resolver to be used
        second - the entity resolver to be used if the first one returns null
    • Method Detail

      • resolveEntity

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

        public org.xml.sax.InputSource getExternalSubset​(java.lang.String name,
                                                         java.lang.String baseURI)
                                                  throws org.xml.sax.SAXException,
                                                         java.io.IOException
        Specified by:
        getExternalSubset in interface org.xml.sax.ext.EntityResolver2
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • resolveEntity

        public org.xml.sax.InputSource resolveEntity​(java.lang.String name,
                                                     java.lang.String publicId,
                                                     java.lang.String baseURI,
                                                     java.lang.String systemId)
                                              throws org.xml.sax.SAXException,
                                                     java.io.IOException
        Specified by:
        resolveEntity in interface org.xml.sax.ext.EntityResolver2
        Throws:
        org.xml.sax.SAXException
        java.io.IOException