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
All Implemented Interfaces:
Validator<T>, Consumer<T>

@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();
     }
 
  • Constructor Details

    • NotNullValidator

      public NotNullValidator()
    • NotNullValidator

      public NotNullValidator(String message)
      Constructor for custom error message.
      Parameters:
      message - error message
  • Method Details