org.apache.wicket.validation.validator
Class DateValidator

java.lang.Object
  extended by org.apache.wicket.validation.validator.AbstractValidator<Date>
      extended by org.apache.wicket.validation.validator.DateValidator
All Implemented Interfaces:
Serializable, IClusterable, INullAcceptingValidator<Date>, IValidator<Date>

public abstract class DateValidator
extends AbstractValidator<Date>

Validator for checking dates. This validator can be extended or can be used for one of its static factory methods to get the default DateValidator as a range, maximum, or minimum type.

Since:
1.2.6
Author:
Jonathan Locke, Johan Compagner, Igor Vaynberg (ivaynberg)
See Also:
Serialized Form

Constructor Summary
DateValidator()
           
 
Method Summary
static DateValidator maximum(Date maximum)
          Gets a Date maximum validator for checking if a Date value is smaller than the given maximum value.
static DateValidator maximum(Date maximum, String format)
           
static DateValidator minimum(Date minimum)
          Gets a Date minimum validator for checking if a Date value is greater than the given minimum Date value.
static DateValidator minimum(Date minimum, String format)
           
static DateValidator range(Date minimum, Date maximum)
          Gets a Date range validator for checking if the Date value falls between the minimum and maximum Date values.
static DateValidator range(Date minimum, Date maximum, String format)
           
 
Methods inherited from class org.apache.wicket.validation.validator.AbstractValidator
error, error, error, error, messageModel, onValidate, resourceKey, resourceKey, validate, validate, validateOnNullValue, variablesMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateValidator

public DateValidator()
Method Detail

range

public static DateValidator range(Date minimum,
                                  Date maximum)
Gets a Date range validator for checking if the Date value falls between the minimum and maximum Date values. If that is not the case, an error message will be generated with the key "DateValidator.range". The message keys that can be used are:

Parameters:
minimum - the minimum Date
maximum - the maximum Date
Returns:
the requested DateValidator

range

public static DateValidator range(Date minimum,
                                  Date maximum,
                                  String format)
Parameters:
minimum - the minimum Date
maximum - the maximum Date
format - The format string used to format the date with SimpleDateFormat
Returns:
the requested DateValidator
See Also:
range(Date, Date)

minimum

public static DateValidator minimum(Date minimum)
Gets a Date minimum validator for checking if a Date value is greater than the given minimum Date value. If that is not the case, an error message will be generated with the key "DateValidator.minimum". The message keys that can be used are:

Parameters:
minimum - the minimum Date
Returns:
the requested DateValidator

minimum

public static DateValidator minimum(Date minimum,
                                    String format)
Parameters:
minimum - the minimum Date
format - The format string used to format the date with SimpleDateFormat
Returns:
the requested DateValidator
See Also:
minimum(Date)

maximum

public static DateValidator maximum(Date maximum)
Gets a Date maximum validator for checking if a Date value is smaller than the given maximum value. If that is not the case, an error message will be generated with the key "DateValidator.maximum". The message keys that can be used are:

Parameters:
maximum - the maximum Date
Returns:
the requested DateValidator

maximum

public static DateValidator maximum(Date maximum,
                                    String format)
Parameters:
maximum - the maximum Date
format - The format string used to format the date with SimpleDateFormat
Returns:
the requested DateValidator
See Also:
maximum(Date)


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.