T
- value type@Component(value="ui_NotNullValidator") @Scope(value="prototype") public class NotNullValidator<T> extends AbstractValidator<T>
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(); }
currentAuthentication, datatypeRegistry, message, messages, substitutor
Constructor and Description |
---|
NotNullValidator() |
NotNullValidator(java.lang.String message)
Constructor for custom error message.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(T value)
Checks a value.
|
protected void |
setMessages(io.jmix.core.Messages messages) |
formatValue, getMessage, getTemplateErrorMessage, setMessage
public NotNullValidator()
public NotNullValidator(java.lang.String message)
message
- error message@Autowired protected void setMessages(io.jmix.core.Messages messages)
public void accept(T value) throws ValidationException
Validator
value
- a valueValidationException