net.sf.bvalid
Class ValidatorOption

java.lang.Object
  extended by net.sf.bvalid.ValidatorOption

public class ValidatorOption
extends java.lang.Object

An option that can be used to configure a Validator. Options are passed to the ValidatorFactory when obtaining a validator.

Author:
cwilper@cs.cornell.edu

Field Summary
static ValidatorOption CACHE_PARSED_GRAMMARS
          Whether the validator should cache parsed grammars in memory after they have been successfully used to validate an instance document.
static ValidatorOption FAIL_ON_MISSING_REFERENCED
          Whether validation should fail when a schema referenced within the instance document cannot be found.
 
Constructor Summary
protected ValidatorOption(java.lang.String name, java.lang.String description, java.lang.String[] validValues, java.lang.String defaultValue)
           
 
Method Summary
 java.lang.String getDefaultValue()
          Get the default value for this option.
 java.lang.String getDescription()
          Get the description of the option.
 java.lang.String getName()
          Get the name of the option.
 java.lang.String[] getValidValues()
          Get the set of valid values for this option.
 boolean isValidValue(java.lang.String value)
          Tell whether the given value is valid for this option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FAIL_ON_MISSING_REFERENCED

public static final ValidatorOption FAIL_ON_MISSING_REFERENCED
Whether validation should fail when a schema referenced within the instance document cannot be found. Valid values are "true" and "false". Default value is "true".


CACHE_PARSED_GRAMMARS

public static final ValidatorOption CACHE_PARSED_GRAMMARS
Whether the validator should cache parsed grammars in memory after they have been successfully used to validate an instance document. Valid values are "true" and "false". Default value is "false".

Constructor Detail

ValidatorOption

protected ValidatorOption(java.lang.String name,
                          java.lang.String description,
                          java.lang.String[] validValues,
                          java.lang.String defaultValue)
Method Detail

getName

public java.lang.String getName()
Get the name of the option. This should be unique among options. By convention, it contains all lowercase characters and uses dashes (-) as word separators.


getDescription

public java.lang.String getDescription()
Get the description of the option.


getValidValues

public java.lang.String[] getValidValues()
Get the set of valid values for this option. If valid values are not constrained to a list, return null.


getDefaultValue

public java.lang.String getDefaultValue()
Get the default value for this option. If there is no default value, return null.


isValidValue

public boolean isValidValue(java.lang.String value)
Tell whether the given value is valid for this option.