Class DTDManager
java.lang.Object
com.aquima.interactions.foundation.xml.parsing.DTDManager
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInternalDTD
(String dtdId, File dtdFile) Adds an internal DTD to the table.void
addInternalDTD
(String dtdId, String theDTD) Adds an internal DTD to the table.resolveEntity
(String publicID, String systemID)
-
Constructor Details
-
DTDManager
public DTDManager()
-
-
Method Details
-
addInternalDTD
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
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
- Specified by:
resolveEntity
in interfaceEntityResolver
- Throws:
SAXException
IOException
-