com.calitha.xml
Class CachingURLResolver
java.lang.Object
com.calitha.xml.CachingURLResolver
- All Implemented Interfaces:
- URIResolver, EntityResolver
public final class CachingURLResolver
- extends Object
- implements EntityResolver, URIResolver
This resolver can be used to resolve requests for schemas and
other resources.
These resources are loaded using the systemid and cached in a
URLContentCache.
Example for using this class:
DOMParser parser = new DOMParser();
parser.setEntityResolver(new CachingSchemaResolver());
- Author:
- Robert van Loenhout
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachingURLResolver
public CachingURLResolver()
- Creates a new CachingURLResolver.
It does not matter
whether you use the same resolver multiple times or
keep creating new resolvers, since the same global cache is used.
resolveEntity
public InputSource resolveEntity(String publicId,
String systemId)
throws IOException
- Specified by:
resolveEntity in interface EntityResolver
- Throws:
IOException
resolve
public Source resolve(String href,
String base)
throws TransformerException
- Specified by:
resolve in interface URIResolver
- Throws:
TransformerException