T
- value type@Component(value="cuba_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 web-spring.xml
,
for example:
<bean id="cuba_NotNullValidator" class="com.haulmont.cuba.gui.components.validation.NotNullValidator" scope="prototype"/>Use
BeanLocator
when creating the validator programmatically.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
datatypeRegistry, message, messages, userSessionSource
Constructor and Description |
---|
NotNullValidator() |
NotNullValidator(java.lang.String message)
Constructor for custom error message.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(T value) |
protected void |
setMessages(Messages messages) |
formatValue, getMessage, getTemplateErrorMessage, setMessage
public static final java.lang.String NAME
public NotNullValidator()
public NotNullValidator(java.lang.String message)
message
- error message@Inject protected void setMessages(Messages messages)
public void accept(T value) throws ValidationException
ValidationException