Package io.jmix.ui.component.validation
Class EmailValidator
java.lang.Object
io.jmix.ui.component.validation.AbstractValidator<String>
io.jmix.ui.component.validation.EmailValidator
@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(); }
-
Nested Class Summary
-
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.collectEmails
(String emailString) protected int
protected String
protected void
setMessages
(Messages messages) protected void
setValidator
(javax.validation.Validator validator) Methods inherited from class io.jmix.ui.component.validation.AbstractValidator
formatValue, getMessage, getTemplateErrorMessage, setMessage
-
Field Details
-
validator
protected javax.validation.Validator validator
-
-
Constructor Details
-
EmailValidator
public EmailValidator()
-
-
Method Details
-
setMessages
-
setValidator
@Autowired protected void setValidator(javax.validation.Validator validator) -
accept
Description copied from interface:Validator
Checks a value.- Parameters:
value
- a value
-
collectEmails
-
preventEmpty
-
getSepIdx
-