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
Fields inherited from class io.jmix.flowui.component.validation.AbstractValidator
applicationContext, currentAuthentication, datatypeRegistry, defaultMessage, message, messages, substitutor
-
Constructor Summary
ConstructorDescriptionConstructor with default error message.DecimalMinValidator
(BigDecimal min, String message) Constructor with custom error message. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks a value.protected void
fireValidationException
(T value) getMin()
boolean
void
setInclusive
(boolean inclusive) Set to true if the value must be greater than or equal to the specified minimum.void
setMin
(BigDecimal min) Sets min value.void
setMin
(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, setMessage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:Validator
Checks a value. -
fireValidationException
-