| java.lang.Object org.apache.commons.validator.DateValidator
DateValidator | public class DateValidator (Code) | | Perform date validations.
This class is a Singleton; you can retrieve the instance via the
getInstance() method.
version: $Revision: 478334 $ $Date: 2006-11-22 21:31:54 +0000 (Wed, 22 Nov 2006) $ since: Validator 1.1 |
Constructor Summary | |
protected | DateValidator() Protected constructor for subclasses to use. |
DateValidator | protected DateValidator()(Code) | | Protected constructor for subclasses to use.
|
getInstance | public static DateValidator getInstance()(Code) | | Returns the Singleton instance of this validator.
A singleton instance of the DateValidator. |
isValid | public boolean isValid(String value, String datePattern, boolean strict)(Code) | | Checks if the field is a valid date. The pattern is used with
java.text.SimpleDateFormat . If strict is true, then the
length will be checked so '2/12/1999' will not pass validation with
the format 'MM/dd/yyyy' because the month isn't two digits.
The setLenient method is set to false for all.
Parameters: value - The value validation is being performed on. Parameters: datePattern - The pattern passed to SimpleDateFormat . Parameters: strict - Whether or not to have an exact match of the datePattern. true if the date is valid. |
isValid | public boolean isValid(String value, Locale locale)(Code) | | Checks if the field is a valid date. The Locale is
used with java.text.DateFormat . The setLenient method
is set to false for all.
Parameters: value - The value validation is being performed on. Parameters: locale - The locale to use for the date format, defaults to the defaultsystem default if null. true if the date is valid. |
|
|