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 Summary
FieldsFields inherited from class io.jmix.flowui.component.validation.AbstractValidator
applicationContext, currentAuthentication, datatypeRegistry, defaultMessage, message, messages, substitutor -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with default error message.DecimalMinValidator(BigDecimal min, String message) Constructor with custom error message. -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks a value.protected voidfireValidationException(T value) @Nullable BigDecimalgetMin()booleanvoidsetInclusive(boolean inclusive) Set to true if the value must be greater than or equal to the specified minimum.voidsetMin(@Nullable BigDecimal min) Sets min value.voidsetMin(@Nullable BigDecimal min, boolean inclusive) Sets min value and inclusive option.Methods inherited from class io.jmix.flowui.component.validation.AbstractValidator
afterPropertiesSet, fireValidationException, fireValidationException, formatValue, getMessage, getTemplateErrorMessage, setApplicationContext, setMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
-
Field Details
-
min
-
inclusive
protected boolean inclusive
-
-
Constructor Details
-
DecimalMinValidator
public DecimalMinValidator() -
DecimalMinValidator
Constructor with default error message.- Parameters:
min- min value
-
DecimalMinValidator
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 valuemessage- error message
-
-
Method Details
-
setMin
Sets min value.- Parameters:
min- min value
-
getMin
- Returns:
- min value
-
setMin
Sets min value and inclusive option.- Parameters:
min- min valueinclusive- 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
Description copied from interface:ValidatorChecks a value. -
fireValidationException
-