org.apache.commons.validator
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
Since: Validator 1.1
| Field Summary | |
|---|---|
| static String | ATOM |
| static String | ATOM_PATTERN |
| static String | DOMAIN_PATTERN |
| static String | EMAIL_PATTERN |
| static EmailValidator | instance
Singleton instance of this class. |
| static String | IP_DOMAIN_PATTERN |
| static String | LEGAL_ASCII_PATTERN |
| static String | QUOTED_USER |
| static String | SPECIAL_CHARS |
| static String | USER_PATTERN |
| static String | VALID_CHARS |
| static String | WORD |
| Constructor Summary | |
|---|---|
| protected | EmailValidator()
Protected constructor for subclasses to use. |
| Method Summary | |
|---|---|
| static EmailValidator | getInstance()
Returns the Singleton instance of this validator. |
| boolean | isValid(String email) Checks if a field has a valid e-mail address. |
| protected boolean | isValidDomain(String domain)
Returns true if the domain component of an email address is valid. |
| protected boolean | isValidIpAddress(Perl5Util ipAddressMatcher)
Validates an IP address. |
| protected boolean | isValidSymbolicDomain(String domain)
Validates a symbolic domain name. |
| protected boolean | isValidUser(String user)
Returns true if the user component of an email address is valid. |
Checks if a field has a valid e-mail address.
Parameters: email The value validation is being performed on. A null
value is considered invalid.
Parameters: domain being validatied.
Parameters: ipAddressMatcher Pattren matcher
Parameters: domain symbolic domain name
Parameters: user being validated