org.apache.fulcrum.intake.validator
Class BooleanValidator
java.lang.Object
org.apache.fulcrum.intake.validator.DefaultValidator
org.apache.fulcrum.intake.validator.BooleanValidator
- All Implemented Interfaces:
- InitableByConstraintMap, Validator
public class BooleanValidator
- extends DefaultValidator
Validator for boolean field types.
Values are validated by attemting to match the value to
a list of strings for true and false values. The string
values are compared without reguard to case.
Valid values for Boolean.TRUE:
Valid values for Boolean.FALSE:
- Version:
- $Id: BooleanValidator.java 671324 2008-06-24 20:01:41Z tv $
- Author:
- Quinton McCombs, Colin Chalmers, Jürgen Hoffmann
Method Summary |
void |
assertValidity(String testValue)
Determine whether a testValue meets the criteria specified
in the constraints defined for this validator |
Boolean |
parse(String stringValue)
Parses a srting value into a Boolean object. |
Methods inherited from class org.apache.fulcrum.intake.validator.DefaultValidator |
assertValidity, getMaxLength, getMaxLengthMessage, getMessage, getMinLength, getMinLengthMessage, getRequiredMessage, init, isRequired, isValid, isValid, setMaxLength, setMaxLengthMessage, setMinLength, setMinLengthMessage, setRequired, setRequiredMessage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BooleanValidator
public BooleanValidator()
- Default Constructor
BooleanValidator
public BooleanValidator(Map paramMap)
throws InvalidMaskException
- Constructor to use when initialising Object
- Parameters:
paramMap
-
- Throws:
InvalidMaskException
assertValidity
public void assertValidity(String testValue)
throws ValidationException
- Determine whether a testValue meets the criteria specified
in the constraints defined for this validator
- Specified by:
assertValidity
in interface Validator
- Overrides:
assertValidity
in class DefaultValidator
- Parameters:
testValue
- a String
to be tested
- Throws:
ValidationException
- containing an error message if the
testValue did not pass the validation tests.
parse
public Boolean parse(String stringValue)
throws ParseException
- Parses a srting value into a Boolean object.
- Parameters:
stringValue
- the value to parse
- Returns:
- a
Boolean object
- Throws:
ParseException
Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.