genie.core
Class EntityValidator

java.lang.Object
  extended by genie.core.EntityValidator
All Implemented Interfaces:
IEntityResolver, org.xml.sax.EntityResolver

public class EntityValidator
extends java.lang.Object
implements IEntityResolver

Author:
T. Kia Ntoni 19 févr. 2005 EntityValidator @version

Field Summary
protected  java.util.HashMap entityValidator
          The URLs of entityValidator that have been registered, keyed by the public identifier that corresponds.
 
Constructor Summary
EntityValidator()
           
 
Method Summary
 void register(java.lang.String publicOrSystemId, java.lang.String entityURL)
          Register the specified DTD URL for the specified public identifier.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Resolve the requested external entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityValidator

protected java.util.HashMap entityValidator
The URLs of entityValidator that have been registered, keyed by the public identifier that corresponds.

Constructor Detail

EntityValidator

public EntityValidator()
Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException
Resolve the requested external entity.

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Parameters:
publicId - The public identifier of the entity being referenced
systemId - The system identifier of the entity being referenced
Throws:
org.xml.sax.SAXException - if a parsing exception occurs

register

public void register(java.lang.String publicOrSystemId,
                     java.lang.String entityURL)

Register the specified DTD URL for the specified public identifier. This must be called before the first call to parse().

Digester contains an internal EntityResolver implementation. This maps PUBLICID's to URLs (from which the resource will be loaded). A common use case for this method is to register local URLs (possibly computed at runtime by a classloader) for DTDs. This allows the performance advantage of using a local version without having to ensure every SYSTEM URI on every processed xml document is local. This implementation provides only basic functionality. If more sophisticated features are required, using #setEntityResolver to set a custom resolver is recommended.

Note: This method will have no effect when a custom EntityResolver has been set. (Setting a custom EntityResolver overrides the internal implementation.)

Specified by:
register in interface IEntityResolver
Parameters:
publicOrSystemId - Public identifier of the DTD to be resolved
entityURL - The URL to use for reading this DTD


Copyright © 2004-2005 Genies Projects. All Rights Reserved.