net.sf.bvalid.locator
Class URLSchemaLocator

java.lang.Object
  extended by net.sf.bvalid.locator.URLSchemaLocator
All Implemented Interfaces:
SchemaLocator

public class URLSchemaLocator
extends java.lang.Object
implements SchemaLocator

A SchemaLocator that resolves file:// URLs using the local filesystem, and http:// URLs using a WebClient.

Author:
cwilper@cs.cornell.edu

Constructor Summary
URLSchemaLocator()
           
URLSchemaLocator(WebClient client)
           
 
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
 

Constructor Detail

URLSchemaLocator

public URLSchemaLocator()

URLSchemaLocator

public URLSchemaLocator(WebClient client)
Method Detail

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)
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