autohit.creator.compiler
Class XmlCompilerResolver

java.lang.Object
  extended byautohit.creator.compiler.XmlCompilerResolver
All Implemented Interfaces:
org.xml.sax.EntityResolver

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

Implement our own resolver to handle XML activities. For the most part, this is used to provide DTDs.

The default constructor assumes you do not want to log. If you use the other constructor, supply a valid CreatorLog and a log entry will be made for every resolve.

After construction, you need to register URIs to resolve. If the resolver encounters any URIs that are not registered, it will throw a SAXNotSupportedException exception. In this version, we assume that are resources are Strings. This should be easy to extend in the future.

Version:
1.1 Version History EPG - Initial - 11Apr03
Author:
Erich P. Gatejen

Method Summary
 void register(java.lang.String uri, java.lang.String text)
          Register a resource as an entity.
 org.xml.sax.InputSource resolveEntity(java.lang.String name, java.lang.String uri)
          overrides the resolver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

register

public void register(java.lang.String uri,
                     java.lang.String text)
Register a resource as an entity. The entity is the system URI and *not* the public name It will store the resource in the hashtable keyed on the entity..

Parameters:
uri - A string containing the textual entity to trap and resolve.
text - A string containing actual resource.

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String name,
                                             java.lang.String uri)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException
overrides the resolver.

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Parameters:
name - not implimented.
uri - Passed to this from the parser. We will trap the uri.
Returns:
an input source to be used by the XML parser.
Throws:
org.xml.sax.SAXException
java.io.IOException


Test.