@Deprecated public class EmailValidator extends Object
Perform email validations.
This class is a Singleton; you can retrieve the instance via the getInstance() method.
Based on a script by Sandeep V. Tamhankar http://javascript.internet.com
This implementation is not guaranteed to catch all possible errors in an email address. For example, an address like [email protected] will pass validator, even though there is no TLD "somedog"
.Modifier | Constructor and Description |
---|---|
protected |
EmailValidator()
Deprecated.
Protected constructor for subclasses to use.
|
Modifier and Type | Method and Description |
---|---|
static EmailValidator |
getInstance()
Deprecated.
Returns the Singleton instance of this validator.
|
boolean |
isValid(String email)
Deprecated.
Checks if a field has a valid e-mail address.
|
protected boolean |
isValidDomain(String domain)
Deprecated.
Returns true if the domain component of an email address is valid.
|
protected boolean |
isValidIpAddress(String ipAddress)
Deprecated.
Validates an IP address.
|
protected boolean |
isValidSymbolicDomain(String domain)
Deprecated.
Validates a symbolic domain name.
|
protected boolean |
isValidUser(String user)
Deprecated.
Returns true if the user component of an email address is valid.
|
protected String |
stripComments(String emailStr)
Deprecated.
Recursively remove comments, and replace with a single space.
|
protected EmailValidator()
public static EmailValidator getInstance()
public boolean isValid(String email)
Checks if a field has a valid e-mail address.
email
- The value validation is being performed on. A null
value is considered invalid.protected boolean isValidDomain(String domain)
domain
- being validated.protected boolean isValidUser(String user)
user
- being validatedprotected boolean isValidIpAddress(String ipAddress)
ipAddress
- IP addressprotected boolean isValidSymbolicDomain(String domain)
domain
- symbolic domain nameprotected String stripComments(String emailStr)
emailStr
- The email addressCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.