Class DoubleMaxValidator<T>

java.lang.Object
io.jmix.flowui.component.validation.AbstractValidator<T>
io.jmix.flowui.component.validation.DoubleMaxValidator<T>
All Implemented Interfaces:
Validator<T>, Consumer<T>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

@Component("flowui_DoubleMaxValidator") @Scope("prototype") public class DoubleMaxValidator<T> extends AbstractValidator<T> implements org.springframework.beans.factory.InitializingBean
  • Field Details

    • max

      protected Double max
    • inclusive

      protected boolean inclusive
  • Constructor Details

    • DoubleMaxValidator

      public DoubleMaxValidator()
    • DoubleMaxValidator

      public DoubleMaxValidator(Double max)
    • DoubleMaxValidator

      public DoubleMaxValidator(Double max, String message)
      Constructor with custom error message. This message can contain '${value}', and '${max}' keys for formatted output.

      Example: "Value '${value}' should be greater than or equal to '${max}'".

      Parameters:
      max - max value
      message - error message
  • Method Details

    • setMax

      public void setMax(Double max)
      Sets max value.
      Parameters:
      max - max value
    • getMax

      public Double getMax()
      Returns:
      max value
    • setMax

      public void setMax(Double max, boolean inclusive)
      Sets max value and inclusive option.
      Parameters:
      max - max value
      inclusive - inclusive option
    • setInclusive

      public void setInclusive(boolean inclusive)
      Set to true if the value must be greater than or equal to the specified maximum. Default value is true.
      Parameters:
      inclusive - inclusive option
    • isInclusive

      public boolean isInclusive()
      Returns:
      true if the value must be greater than or equal to the specified maximum
    • accept

      public void accept(@Nullable T value) throws ValidationException
      Description copied from interface: Validator
      Checks a value.
      Specified by:
      accept in interface Consumer<T>
      Specified by:
      accept in interface Validator<T>
      Parameters:
      value - a value
      Throws:
      ValidationException
    • fireValidationException

      protected void fireValidationException(T value)