net.sf.bvalid.locator
Class CachingSchemaLocator
java.lang.Object
net.sf.bvalid.locator.CachingSchemaLocator
- All Implemented Interfaces:
- SchemaLocator
public class CachingSchemaLocator
- extends java.lang.Object
- implements SchemaLocator
A SchemaLocator
that automatically caches successfully-used
schemas to an underlying catalog.
- Author:
- cwilper@cs.cornell.edu
Method Summary |
java.io.InputStream |
get(java.lang.String uri,
boolean required)
Get the content of the indicated schema. |
void |
successfullyUsed(java.lang.String uri)
Notify the locator that the indicated schema was just used for a
sucessful validation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachingSchemaLocator
public CachingSchemaLocator(SchemaCatalog candidateCatalog,
SchemaCatalog cacheCatalog,
SchemaLocator locator)
get
public java.io.InputStream get(java.lang.String uri,
boolean required)
throws ValidatorException
- Description copied from interface:
SchemaLocator
- Get the content of the indicated schema.
If the schema is not found and required is false, return null.
If the schema is not found and required is true, throw an exception.
- Specified by:
get
in interface SchemaLocator
- Throws:
ValidatorException
successfullyUsed
public void successfullyUsed(java.lang.String uri)
throws ValidatorException
- Description copied from interface:
SchemaLocator
- Notify the locator that the indicated schema was just used for a
sucessful validation.
This information is particularly useful for SchemaLocators
that do caching. Other implementations may simply ignore the
the message.
- Specified by:
successfullyUsed
in interface SchemaLocator
- Throws:
ValidatorException