Class FSEntityResolver

java.lang.Object
org.xhtmlrenderer.resource.FSEntityResolver
All Implemented Interfaces:
EntityResolver

public class FSEntityResolver extends Object implements EntityResolver

A SAX EntityResolver for common entity references and DTDs in X/HTML processing. Maps official entity references to local copies to avoid network lookup. The local copies are stored in the source tree under /entities, and the references here are resolved by a system ClassLoader. As long as the entity files are in the classpath (or bundled in the FS jar), they will be picked up.

The basic form of this class comes from Elliot Rusty Harold, on http://www.cafeconleche.org/books/xmljava/chapters/ch07s02.html

This class is a Singleton; use instance to retrieve it.

Author:
Patrick Wright
  • Method Details

    • resolveEntity

      public InputSource resolveEntity(String publicID, String systemID) throws SAXException
      Description of the Method
      Specified by:
      resolveEntity in interface EntityResolver
      Parameters:
      publicID - PARAM
      systemID - PARAM
      Returns:
      Returns
      Throws:
      SAXException - Throws
    • instance

      public static FSEntityResolver instance()
      Gets an instance of this class.
      Returns:
      An instance of .
    • getEntities

      public Map getEntities()
      Returns a map of entities parsed by this resolver.
      Returns:
      a map of entities parsed by this resolver.