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 Summary
Fields inherited from class io.jmix.flowui.component.validation.AbstractValidator
applicationContext, currentAuthentication, datatypeRegistry, defaultMessage, message, messages, substitutor
-
Constructor Summary
ConstructorDescriptionDoubleMaxValidator
(Double max) DoubleMaxValidator
(Double max, String message) Constructor with custom error message. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks a value.protected void
fireValidationException
(T value) getMax()
boolean
void
setInclusive
(boolean inclusive) Set to true if the value must be greater than or equal to the specified maximum.void
Sets max value.void
Sets max 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
-
max
-
inclusive
protected boolean inclusive
-
-
Constructor Details
-
DoubleMaxValidator
public DoubleMaxValidator() -
DoubleMaxValidator
-
DoubleMaxValidator
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 valuemessage
- error message
-
-
Method Details
-
setMax
Sets max value.- Parameters:
max
- max value
-
getMax
- Returns:
- max value
-
setMax
Sets max value and inclusive option.- Parameters:
max
- max valueinclusive
- 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
Description copied from interface:Validator
Checks a value. -
fireValidationException
-