Class DateValidator

All Implemented Interfaces:
Serializable, IComponentAwareEventSink, IComponentAwareHeaderContributor, IClusterable, IValidator<Date>

public class DateValidator extends RangeValidator<Date>
Validator for checking if a given date falls within [min,max] range. If either min or max are null they are not checked.

Resource keys:

  • DateValidator.exact if min==max
  • DateValidator.range if both min and max are not null
  • DateValidator.minimum if max is null
  • DateValidator.maximum if min is null

Error Message Variables:

  • name: the id of Component that failed
  • label: the label of the Component (either comes from FormComponent.labelModel or resource key <form-id>.<form-component-id>
  • input: the input value
  • inputdate: the formatted input value
  • minimum: the minimum allowed value
  • maximum: the maximum allowed value

Author:
igor
See Also:
  • Constructor Details

    • DateValidator

      public DateValidator(Date minimum, Date maximum, String format)
      Constructor that sets the minimum and maximum date values and a custom date formating.
      Parameters:
      minimum - the minimum date
      maximum - the maximum date
      format - The format string used to format the date with SimpleDateFormat
    • DateValidator

      public DateValidator(Date minimum, Date maximum)
      Constructor that sets the minimum and maximum date values.
      Parameters:
      minimum - the minimum date
      maximum - the maximum date
    • DateValidator

      protected DateValidator()
      Constructor used for subclasses who want to set the range using AbstractRangeValidator.setRange(Comparable, Comparable)
  • Method Details