Class DecimalMinValidator<T>

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

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

    • min

      protected BigDecimal min
    • inclusive

      protected boolean inclusive
  • Constructor Details

    • DecimalMinValidator

      public DecimalMinValidator()
    • DecimalMinValidator

      public DecimalMinValidator(BigDecimal min)
      Constructor with default error message.
      Parameters:
      min - min value
    • DecimalMinValidator

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

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

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

    • setMin

      public void setMin(@Nullable BigDecimal min)
      Sets min value.
      Parameters:
      min - min value
    • getMin

      @Nullable public BigDecimal getMin()
      Returns:
      min value
    • setMin

      public void setMin(@Nullable BigDecimal min, boolean inclusive)
      Sets min value and inclusive option.
      Parameters:
      min - min 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 minimum. 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 minimum
    • 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)