gov.llnl.babel.parsers.xml
public class DTDManager extends java.lang.Object implements org.xml.sax.EntityResolver
DTDManager
is a singleton class that manages the DTDs for
the sidl symbol, comment, and HTML descriptions needed to parse sidl
symbols in XML format. If the application does not explicitly set the
path to the sidl DTDs, the the DTD manager will query the system property
"gov.llnl.babel.sidl.DTDPath". This manager also defines the PUBLIC
identifiers for symbol and comment DTDs used to validate SIXL XML symbols.
The PUBLIC symbol identifier is "-//CCA/sidl Symbol DTD v1.0//EN" and the
HTML lite comment identifier is "-//CCA/sidl HTML DTD v1.0//EN". The DTD
manager object can act as a symbol resolver for a SAX parser to interpret
these PUBLIC identifiers.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMENT_FILE |
static java.lang.String |
COMMENT_PUBLIC_ID |
static java.lang.String |
HTML_PUBLIC_ID |
static java.lang.String |
SYMBOL_PUBLIC_ID |
Constructor and Description |
---|
DTDManager()
Create a new instance of the DTD manager.
|
Modifier and Type | Method and Description |
---|---|
static DTDManager |
getInstance()
Return the singleton instance of the DTD manager.
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String public_id,
java.lang.String system_id)
Provide the implementation of an
EntityResolver to
convert the symbol PUBLIC identifier into a URL for the symbol DTD. |
static void |
setInstance(DTDManager instance)
Set the singleton instance of the DTD manager.
|
public static final java.lang.String SYMBOL_PUBLIC_ID
public static final java.lang.String HTML_PUBLIC_ID
public static final java.lang.String COMMENT_PUBLIC_ID
public static final java.lang.String COMMENT_FILE
public DTDManager()
getInstance
and setInstance
.public static DTDManager getInstance()
public static void setInstance(DTDManager instance)
getInstance
will automatically create the DTD manager
for you.public org.xml.sax.InputSource resolveEntity(java.lang.String public_id, java.lang.String system_id) throws java.io.IOException
EntityResolver
to
convert the symbol PUBLIC identifier into a URL for the symbol DTD.resolveEntity
in interface org.xml.sax.EntityResolver
java.io.IOException