org.apache.turbine.services.intake.validator
Class DateRangeValidator

java.lang.Object
  extended byorg.apache.turbine.services.intake.validator.DefaultValidator
      extended byorg.apache.turbine.services.intake.validator.DateStringValidator
          extended byorg.apache.turbine.services.intake.validator.DateRangeValidator
All Implemented Interfaces:
InitableByConstraintMap, Validator

public class DateRangeValidator
extends DateStringValidator

Validates a DateString field in dependency on another DateString field.

NameValid ValuesDefault Value
less-than <name of other field>  
greater-than <name of other field>  
less-than-or-equal <name of other field>  
greater-than-or-equal <name of other field>  

Version:
$Id: DateStringValidator.java 534527 2007-05-02 16:10:59Z tv $
Author:
Thomas Vandahl

Field Summary
 
Fields inherited from class org.apache.turbine.services.intake.validator.DefaultValidator
errorMessage, log, maxLength, maxLengthMessage, minLength, minLengthMessage, required, requiredMessage
 
Fields inherited from interface org.apache.turbine.services.intake.validator.Validator
FLEXIBLE_RULE_NAME, FORMAT_RULE_NAME, INVALID_NUMBER_RULE_NAME, MASK_RULE_NAME, MAX_LENGTH_RULE_NAME, MAX_VALUE_RULE_NAME, MIN_LENGTH_RULE_NAME, MIN_VALUE_RULE_NAME, REQUIRED_RULE_NAME
 
Constructor Summary
DateRangeValidator()
          Default constructor
DateRangeValidator(java.util.Map paramMap)
           
 
Method Summary
 void assertValidity(Field testField)
          Determine whether a testValue meets the criteria specified in the constraints defined for this validator
 void assertValidity(java.lang.String testValue, Group group)
          Determine whether a testValue meets the criteria specified in the constraints defined for this validator
 void init(java.util.Map paramMap)
          Constructor to use when initialising Object
 
Methods inherited from class org.apache.turbine.services.intake.validator.DateStringValidator
assertValidity, format, getDateFormatMessage, getDateFormats, isFlexible, parse, setDateFormatMessage, setDateFormats, setFlexible
 
Methods inherited from class org.apache.turbine.services.intake.validator.DefaultValidator
getMaxLength, getMaxLengthMessage, getMessage, getMinLength, getMinLengthMessage, getRequiredMessage, 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
 

Constructor Detail

DateRangeValidator

public DateRangeValidator(java.util.Map paramMap)
                   throws IntakeException

DateRangeValidator

public DateRangeValidator()
Default constructor

Method Detail

init

public void init(java.util.Map paramMap)
          throws InvalidMaskException
Constructor to use when initialising Object

Specified by:
init in interface InitableByConstraintMap
Overrides:
init in class DateStringValidator
Parameters:
paramMap -
Throws:
InvalidMaskException

assertValidity

public void assertValidity(Field testField)
                    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:
testField - a Field to be tested
Throws:
ValidationException - containing an error message if the testValue did not pass the validation tests.

assertValidity

public void assertValidity(java.lang.String testValue,
                           Group group)
                    throws ValidationException
Determine whether a testValue meets the criteria specified in the constraints defined for this validator

Parameters:
testValue - a String to be tested
group - the group this field belongs to
Throws:
ValidationException - containing an error message if the testValue did not pass the validation tests.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.