org.freehep.xml.util
Class ClassPathEntityResolver

java.lang.Object
  extended by org.freehep.xml.util.ClassPathEntityResolver
All Implemented Interfaces:
EntityResolver

public class ClassPathEntityResolver
extends Object
implements EntityResolver

An implementation of an EntityResolver which can be used to locate DTD files located on the current java class path

Version:
$Id: ClassPathEntityResolver.java 8584 2006-08-10 23:06:37Z duns $
Author:
Tony Johnson (tonyj@slac.stanford.edu)

Constructor Summary
ClassPathEntityResolver(Class root, String DTDPrefix)
          Create a ClassPathEntityResolver that can handle a collection of DTD's
ClassPathEntityResolver(String DTDName, Class root)
          Create a ClassPathEntityResolver that will handle a single DTD.
 
Method Summary
 InputSource resolveEntity(String publicId, String systemId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathEntityResolver

public ClassPathEntityResolver(String DTDName,
                               Class root)
Create a ClassPathEntityResolver that will handle a single DTD.

Parameters:
DTDName - The DTDName to resolve (e.g. myStuff.dtd)
root - A class in the same package as the DTD

ClassPathEntityResolver

public ClassPathEntityResolver(Class root,
                               String DTDPrefix)
Create a ClassPathEntityResolver that can handle a collection of DTD's

Parameters:
root - A class in the package to be used as the root of the DTD path
DTDPrefix - A string containing the prefix for the DTD to match
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException
Specified by:
resolveEntity in interface EntityResolver
Throws:
SAXException


Copyright © 2000-2007 FreeHEP. All Rights Reserved.