Package io.jmix.ui.component.validation
Class NotBlankValidator
java.lang.Object
io.jmix.ui.component.validation.AbstractValidator<String>
io.jmix.ui.component.validation.NotBlankValidator
@Component("ui_NotBlankValidator")
@Scope("prototype")
public class NotBlankValidator
extends AbstractValidator<String>
NotBlank validator checks that value contains at least one non-whitespace character.
In order to provide your own implementation globally, create a subclass and register it in configuration class, for example:
@Bean("ui_NotBlankValidator") @Scope(BeanDefinition.SCOPE_PROTOTYPE) @Primary protected NotBlankValidator notBlankValidator() { return new CustomNotBlankValidator(); }
-
Field Summary
Fields inherited from class io.jmix.ui.component.validation.AbstractValidator
currentAuthentication, datatypeRegistry, message, messages, substitutor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks a value.protected void
setMessages
(Messages messages) Methods inherited from class io.jmix.ui.component.validation.AbstractValidator
formatValue, getMessage, getTemplateErrorMessage, setMessage
-
Constructor Details
-
NotBlankValidator
public NotBlankValidator() -
NotBlankValidator
Constructor for custom error message.- Parameters:
message
- error message
-
-
Method Details
-
setMessages
-
accept
Description copied from interface:Validator
Checks a value.- Parameters:
value
- a value- Throws:
ValidationException
-