java.lang.Object
com.aquima.interactions.foundation.xml.parsing.DTDManager
All Implemented Interfaces:
EntityResolver

public class DTDManager extends Object implements EntityResolver
The manager and resolver for internal DTDs. This means that it has an in-memory table of DTD ids mapped to the corresponding DTD itself. When used as an EntityResolver with a SAX2/DOM parser, it will resolve the system entities to the documents in the internal table. No system entities will be read from disk or loaded from other URLs, all entity data is taken from a memory buffer.

Note that all, not only DTD, entities are resolved!

The DTDManager is not synchronized.

Since:
5.0
Author:
IdJ
  • Constructor Details

    • DTDManager

      public DTDManager()
  • Method Details

    • addInternalDTD

      public void addInternalDTD(String dtdId, File dtdFile) throws IOException
      Adds an internal DTD to the table.
      Parameters:
      dtdId - the ID of the DTD (usually, the system entity name)
      dtdFile - the file from which the DTD data should be loaded
      Throws:
      IOException - when the data could not be loaded
    • addInternalDTD

      public void addInternalDTD(String dtdId, String theDTD)
      Adds an internal DTD to the table.
      Parameters:
      dtdId - the ID of the DTD (usually, the system entity name)
      theDTD - the DTD data itself
    • resolveEntity

      public InputSource resolveEntity(String publicID, String systemID) throws SAXException, IOException
      Specified by:
      resolveEntity in interface EntityResolver
      Throws:
      SAXException
      IOException