Class EmailValidator

java.lang.Object
io.jmix.ui.component.validation.AbstractValidator<String>
io.jmix.ui.component.validation.EmailValidator
All Implemented Interfaces:
Validator<String>, Consumer<String>

@Component("ui_EmailValidator") @Scope("prototype") public class EmailValidator extends AbstractValidator<String>
Email validator checks that String value is email or contains multiple emails separated by a semicolon or comma.

In order to provide your own implementation globally, create a subclass and register it in configuration class, for example:

     @Bean("ui_EmailValidator")
     @Scope(BeanDefinition.SCOPE_PROTOTYPE)
     @Primary
     protected EmailValidator emailValidator() {
          return new CustomEmailValidator();
     }
 
  • Field Details

    • validator

      protected javax.validation.Validator validator
  • Constructor Details

    • EmailValidator

      public EmailValidator()
  • Method Details

    • setMessages

      @Autowired protected void setMessages(Messages messages)
    • setValidator

      @Autowired protected void setValidator(javax.validation.Validator validator)
    • accept

      public void accept(String value)
      Description copied from interface: Validator
      Checks a value.
      Parameters:
      value - a value
    • collectEmails

      protected List<String> collectEmails(String emailString)
    • preventEmpty

      protected String preventEmpty(String s)
    • getSepIdx

      protected int getSepIdx(String emailString)