Class EmailValidator

  • All Implemented Interfaces:
    Validator, Serializable

    public class EmailValidator
    extends RegexpValidator
    String validator for e-mail addresses. The e-mail address syntax is not complete according to RFC 822 but handles the vast majority of valid e-mail addresses correctly. See AbstractStringValidator for more information.

    An empty string or a null is always accepted - use the required flag on fields or a separate validator (or override RegexpValidator.isValidValue(String)) to fail on empty values.

    Since:
    5.4
    Author:
    Vaadin Ltd.
    See Also:
    Serialized Form
    • Constructor Detail

      • EmailValidator

        public EmailValidator​(String errorMessage)
        Creates a validator for checking that a string is a syntactically valid e-mail address.
        Parameters:
        errorMessage - the message to display in case the value does not validate.