Package io.jmix.ui.component.validation
Class NotNullValidator<T>
java.lang.Object
io.jmix.ui.component.validation.AbstractValidator<T>
io.jmix.ui.component.validation.NotNullValidator<T>
- Type Parameters:
T
- value type
@Component("ui_NotNullValidator")
@Scope("prototype")
public class NotNullValidator<T>
extends AbstractValidator<T>
NotNull validator checks that value is not null.
In order to provide your own implementation globally, create a subclass and register it in configuration class, for example:
@Bean("ui_NotNullValidator") @Scope(BeanDefinition.SCOPE_PROTOTYPE) @Primary protected NotNullValidator notNullValidator() { return new CustomNotNullValidator(); }
-
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
-
NotNullValidator
public NotNullValidator() -
NotNullValidator
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
-