Class DecimalMaxValidator<T>
java.lang.Object
io.jmix.flowui.component.validation.AbstractValidator<T>
io.jmix.flowui.component.validation.DecimalMaxValidator<T>
- All Implemented Interfaces:
- Validator<T>,- Consumer<T>,- org.springframework.beans.factory.Aware,- org.springframework.beans.factory.InitializingBean,- org.springframework.context.ApplicationContextAware
@Component("flowui_DecimalMaxValidator")
@Scope("prototype")
public class DecimalMaxValidator<T>
extends AbstractValidator<T>
- 
Field SummaryFieldsFields inherited from class io.jmix.flowui.component.validation.AbstractValidatorapplicationContext, currentAuthentication, datatypeRegistry, defaultMessage, message, messages, substitutor
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor with default error message.DecimalMaxValidator(BigDecimal max, String message) Constructor with custom error message.
- 
Method SummaryModifier and TypeMethodDescriptionvoidChecks a value.protected voidfireValidationException(T value) getMax()booleanvoidsetInclusive(boolean inclusive) Set to true if the value must be less than or equal to the specified maximum.voidsetMax(BigDecimal max) Sets max value.voidsetMax(BigDecimal max, boolean inclusive) Sets max value and inclusive option.Methods inherited from class io.jmix.flowui.component.validation.AbstractValidatorafterPropertiesSet, fireValidationException, fireValidationException, formatValue, getMessage, getTemplateErrorMessage, setApplicationContext, setMessage
- 
Field Details- 
max
- 
inclusiveprotected boolean inclusive
 
- 
- 
Constructor Details- 
DecimalMaxValidatorpublic DecimalMaxValidator()
- 
DecimalMaxValidatorConstructor with default error message.- Parameters:
- max- max value
 
- 
DecimalMaxValidatorConstructor with custom error message. This message can contain '${value}', and '${max}' keys for formatted output.Example: "Value '${value}' should be less than or equal to '${max}'". - Parameters:
- max- max value
- message- error message
 
 
- 
- 
Method Details- 
setMaxSets max value.- Parameters:
- max- max value
 
- 
getMax- Returns:
- max value
 
- 
setMaxSets max value and inclusive option.- Parameters:
- max- max value
- inclusive- inclusive option
 
- 
setInclusivepublic void setInclusive(boolean inclusive) Set to true if the value must be less than or equal to the specified maximum. Default value is true.- Parameters:
- inclusive- inclusive option
 
- 
isInclusivepublic boolean isInclusive()- Returns:
- true if the value must be less than or equal to the specified maximum
 
- 
acceptDescription copied from interface:ValidatorChecks a value.- Parameters:
- value- a value
- Throws:
- ValidationException
 
- 
fireValidationException
 
-