Class RangeValidatorSupport<T extends Comparable>

All Implemented Interfaces:
FieldValidator, ShortCircuitableValidator, Validator
Direct Known Subclasses:
DateRangeFieldValidator, IntRangeFieldValidator, LongRangeFieldValidator, ShortRangeFieldValidator

public abstract class RangeValidatorSupport<T extends Comparable> extends FieldValidatorSupport
Base class for range based validators. Use this class to develop any other custom range validators.
  • Constructor Details

    • RangeValidatorSupport

      protected RangeValidatorSupport(Class<T> type)
  • Method Details

    • validate

      public void validate(Object object) throws ValidationException
      Description copied from interface: Validator
      The validation implementation must guarantee that setValidatorContext will be called with a non-null ValidatorContext before validate is called.
      Parameters:
      object - the object to be validated.
      Throws:
      ValidationException - is thrown if there is validation error(s).
    • validateValue

      protected void validateValue(Object object, Comparable<T> value, T min, T max)
    • setMin

      public void setMin(T min)
    • getMin

      public T getMin()
    • getMax

      public T getMax()
    • setMinExpression

      public void setMinExpression(String minExpression)
    • setMax

      public void setMax(T max)
    • setMaxExpression

      public void setMaxExpression(String maxExpression)
    • getT

      protected T getT(T minMax, String minMaxExpression, Class<T> toType)