Class EmailValidator

    • Constructor Detail

      • EmailValidator

        public EmailValidator​(String errorMessage)
        Creates a validator for checking that a string is a syntactically valid e-mail address.

        This constructor creates a validator which doesn't accept an empty string as a valid e-mail address. Use EmailValidator(String, boolean) constructor with true as a value for the second argument to create a validator which accepts an empty string.

        Parameters:
        errorMessage - the message to display in case the value does not validate.
        See Also:
        EmailValidator(String, boolean)
      • EmailValidator

        public EmailValidator​(String errorMessage,
                              boolean allowEmpty)
        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.
        allowEmpty - if true then an empty string passes the validation, otherwise the validation fails
    • Method Detail

      • isValid

        protected boolean isValid​(String value)
        Description copied from class: RegexpValidator
        Returns whether the given string matches the regular expression.
        Overrides:
        isValid in class RegexpValidator
        Parameters:
        value - the string to match
        Returns:
        true if the string matched, false otherwise