org.jboss.util.xml
Class JBossEntityResolver

java.lang.Object
  extended byorg.jboss.util.xml.JBossEntityResolver
All Implemented Interfaces:
org.xml.sax.EntityResolver

public class JBossEntityResolver
extends java.lang.Object
implements org.xml.sax.EntityResolver

Local entity resolver to handle standard J2EE DTDs and Schemas as well as JBoss specific DTDs.

Function boolean isEntityResolved() is here to avoid validation errors in descriptors that do not have a DOCTYPE declaration.


Constructor Summary
JBossEntityResolver()
           
 
Method Summary
 boolean isEntityResolved()
          Returns the boolean value to inform id DTD was found in the XML file or not
static void registerEntity(java.lang.String publicId, java.lang.String dtdFileName)
          Register the mapping from the public id to the dtd file name.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Returns DTD/Schema inputSource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBossEntityResolver

public JBossEntityResolver()
Method Detail

registerEntity

public static void registerEntity(java.lang.String publicId,
                                  java.lang.String dtdFileName)
Register the mapping from the public id to the dtd file name.

Parameters:
publicId - the DOCTYPE public id, "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
dtdFileName - the simple dtd file name, "ejb-jar.dtd"

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException
Returns DTD/Schema inputSource. If DTD/Schema was found in the hashtable and inputSource was created flag isEntityResolved is set to true.

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Parameters:
publicId - - Public ID of DTD, or null if it is a schema
systemId - - the system ID of DTD or Schema
Returns:
InputSource of entity
Throws:
org.xml.sax.SAXException
java.io.IOException

isEntityResolved

public boolean isEntityResolved()
Returns the boolean value to inform id DTD was found in the XML file or not

Returns:
boolean - true if DTD was found in XML