Class MaxValidator<T extends Number>
java.lang.Object
io.jmix.flowui.component.validation.AbstractValidator<T>
io.jmix.flowui.component.validation.MaxValidator<T>
- All Implemented Interfaces:
Validator<T>
,Consumer<T>
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
@Component("flowui_MaxValidator")
@Scope("prototype")
public class MaxValidator<T extends Number>
extends AbstractValidator<T>
implements org.springframework.beans.factory.InitializingBean
-
Field Summary
Fields inherited from class io.jmix.flowui.component.validation.AbstractValidator
applicationContext, currentAuthentication, datatypeRegistry, message, messages, substitutor
-
Constructor Summary
ConstructorDescriptionMaxValidator
(int max) MaxValidator
(int max, String message) Constructor with custom error message. -
Method Summary
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
protected int max -
defaultMessage
-
-
Constructor Details
-
MaxValidator
public MaxValidator() -
MaxValidator
public MaxValidator(int max) -
MaxValidator
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:
max
- min valuemessage
- error message
-
-
Method Details
-
setMax
public void setMax(int max) Sets max value of the range. Max value cannot be less than 0. Default value isInteger.MAX_VALUE
.Note, max value is included in range. Examples:
value = 5, max = 5 - is valid value = 6, max = 5 - is not valid
- Parameters:
max
- max value
-
getMax
public long getMax()- Returns:
- max value
-
accept
Description copied from interface:Validator
Checks a value.
-