public class DateValidator extends RangeValidator<Date>
null they are not checked.
Resource keys:
DateValidator.exact if min==maxDateValidator.range if both min and max are not nullDateValidator.minimum if max is nullDateValidator.maximum if min is nullError Message Variables:
name: the id of Component that failedlabel: the label of the Component (either comes from
FormComponent.labelModel or resource key <form-id>.<form-component-id>input: the input valueinputdate: the formatted input valueminimum: the minimum allowed valuemaximum: the maximum allowed valueAbstractRangeValidator.Mode| Modifier | Constructor and Description |
|---|---|
protected |
DateValidator()
Constructor used for subclasses who want to set the range using
AbstractRangeValidator.setRange(Comparable, Comparable) |
|
DateValidator(Date minimum,
Date maximum)
Constructor that sets the minimum and maximum date values.
|
|
DateValidator(Date minimum,
Date maximum,
String format)
Constructor that sets the minimum and maximum date values and a custom date formating.
|
| Modifier and Type | Method and Description |
|---|---|
protected IValidationError |
decorate(IValidationError error,
IValidatable<Date> validatable)
Allows subclasses to decorate reported errors
|
static DateValidator |
maximum(Date maximum) |
static DateValidator |
maximum(Date maximum,
String format) |
static DateValidator |
minimum(Date minimum) |
static DateValidator |
minimum(Date minimum,
String format) |
static DateValidator |
range(Date minimum,
Date maximum) |
static DateValidator |
range(Date minimum,
Date maximum,
String format) |
getValuegetMaximum, getMinimum, getMode, setRange, validateafterRender, beforeRender, bind, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onEvent, onException, onRemove, renderHead, unbindpublic DateValidator(Date minimum, Date maximum, String format)
minimum - the minimum datemaximum - the maximum dateformat - The format string used to format the date with SimpleDateFormatpublic DateValidator(Date minimum, Date maximum)
minimum - the minimum datemaximum - the maximum dateprotected DateValidator()
AbstractRangeValidator.setRange(Comparable, Comparable)public static DateValidator range(Date minimum, Date maximum)
minimum - the minimum Datemaximum - the maximum DateDateValidator that validates if a date is between (inclusive) a minimum and
maximumpublic static DateValidator range(Date minimum, Date maximum, String format)
minimum - the minimum Datemaximum - the maximum Dateformat - The format string used to format the date with SimpleDateFormatDateValidator that validates if a date is between (inclusive) a minimum and
maximumpublic static DateValidator minimum(Date minimum)
minimum - the minimum DateDateValidator that validates if a date is after or equal to a minimum datepublic static DateValidator minimum(Date minimum, String format)
minimum - the minimum Dateformat - The format string used to format the date with SimpleDateFormatDateValidator that validates if a date is after or equal to a minimum datepublic static DateValidator maximum(Date maximum)
maximum - the maximum DateDateValidator that validates if a date is before or equal to a maximum datepublic static DateValidator maximum(Date maximum, String format)
maximum - the maximum Dateformat - The format string used to format the date with SimpleDateFormatDateValidator that validates if a date is before or equal to a maximum dateprotected IValidationError decorate(IValidationError error, IValidatable<Date> validatable)
AbstractRangeValidatordecorate in class AbstractRangeValidator<Date,Date>Copyright © 2006–2021 Apache Software Foundation. All rights reserved.