public class DateRangeValidator extends RangeValidator<Date>
Note that the comparison is done directly on the Date object so take care that the hours/minutes/seconds/milliseconds of the min/max values are properly set.
Validator.EmptyValueException, Validator.InvalidValueException
Constructor and Description |
---|
DateRangeValidator(String errorMessage,
Date minValue,
Date maxValue,
Resolution resolution)
Creates a validator for checking that an Date is within a given range.
|
getMaxValue, getMinValue, getType, isMaxValueIncluded, isMinValueIncluded, isValidValue, setMaxValue, setMaxValueIncluded, setMinValue, setMinValueIncluded
getErrorMessage, isValid, isValidType, setErrorMessage, validate
public DateRangeValidator(String errorMessage, Date minValue, Date maxValue, Resolution resolution)
By default the range is inclusive i.e. both minValue and maxValue are
valid values. Use RangeValidator.setMinValueIncluded(boolean)
or
RangeValidator.setMaxValueIncluded(boolean)
to change it.
Note that the comparison is done directly on the Date object so take care that the hours/minutes/seconds/milliseconds of the min/max values are properly set.
errorMessage
- the message to display in case the value does not validate.minValue
- The minimum value to accept or null for no limitmaxValue
- The maximum value to accept or null for no limitCopyright © 2016 Vaadin Ltd. All rights reserved.