public class EmailValidator extends RegexpValidator
Constructor and Description |
---|
EmailValidator(String errorMessage)
Creates a validator for checking that a string is a syntactically valid
e-mail address.
|
EmailValidator(String errorMessage,
boolean allowEmpty)
Creates a validator for checking that a string is a syntactically valid
e-mail address.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
isValid(String value)
Returns whether the given string matches the regular expression.
|
apply, toString
getMessage, toResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
alwaysPass, from, from, from, from
andThen
public EmailValidator(String errorMessage)
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.
errorMessage
- the message to display in case the value does not validate.EmailValidator(String, boolean)
public EmailValidator(String errorMessage, boolean allowEmpty)
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 failsprotected boolean isValid(String value)
RegexpValidator
isValid
in class RegexpValidator
value
- the string to matchCopyright © 2021. All rights reserved.