org.jwarp.service.param
Class BooleanValidator

java.lang.Object
  |
  +--org.jwarp.service.param.AValidator
        |
        +--org.jwarp.service.param.BooleanValidator
All Implemented Interfaces:
IConfigurable, IValidator

public class BooleanValidator
extends AValidator

Validator class for Booleans

Version:
1.01
Author:
Anatole Tresch, Martin Schaefer

Field Summary
(package private)  java.lang.String falseString
           
(package private)  java.lang.String trueString
           
 
Fields inherited from class org.jwarp.service.param.AValidator
contentValidator, mayBeEmpty, required
 
Constructor Summary
BooleanValidator()
          Creates a new boolean validator (true/false).
BooleanValidator(java.lang.String trueString, java.lang.String falseString)
          Creates a new boolean validator given the two strings for true and false.
 
Method Summary
 void configure(org.jdom.Element config)
          Pass the Configuration to the Configurable class.
 java.lang.String getValidationClass()
          Returns the class name of the class being validated.
 void validate(java.lang.Object value)
          Checks if incoming string represents a Boolean (true / false) and sets message accordingly
 
Methods inherited from class org.jwarp.service.param.AValidator
getMayBeEmpty, getNextValidator, getRequired, setMayBeEmpty, setNextValidator, setRequired
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trueString

java.lang.String trueString

falseString

java.lang.String falseString
Constructor Detail

BooleanValidator

public BooleanValidator()
Creates a new boolean validator (true/false).

BooleanValidator

public BooleanValidator(java.lang.String trueString,
                        java.lang.String falseString)
Creates a new boolean validator given the two strings for true and false.
Parameters:
trueString - The string representing true
falseString - The string representing false
Method Detail

configure

public void configure(org.jdom.Element config)
               throws ConfigurationException
Description copied from interface: IConfigurable
Pass the Configuration to the Configurable class. This method must always be called after the constructor and before any other method.
Following copied from interface: org.jwarp.service.configuration.IConfigurable
Parameters:
configuration - the class configurations.

validate

public void validate(java.lang.Object value)
              throws ParameterException
Checks if incoming string represents a Boolean (true / false) and sets message accordingly
Overrides:
validate in class AValidator
Parameters:
contents - The string to be validated
Returns:
true if contents represents a Boolean false if not

getValidationClass

public java.lang.String getValidationClass()
Returns the class name of the class being validated.
Returns:
the full class name

©   O R C A   S y s t e m s