|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.validator.routines.EmailValidator
public class EmailValidator
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 nobody@noplace.somedog will pass validator, even though there is no TLD "somedog"
.
| Constructor Summary | |
|---|---|
protected |
EmailValidator(boolean allowLocal)
Protected constructor for subclasses to use. |
| Method Summary | |
|---|---|
static EmailValidator |
getInstance()
Returns the Singleton instance of this validator. |
static EmailValidator |
getInstance(boolean allowLocal)
Returns the Singleton instance of this validator, with local validation as required. |
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 |
isValidUser(String user)
Returns true if the user component of an email address is valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected EmailValidator(boolean allowLocal)
allowLocal - Should local addresses be considered valid?| Method Detail |
|---|
public static EmailValidator getInstance()
public static EmailValidator getInstance(boolean allowLocal)
allowLocal - Should local addresses be considered valid?
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 validated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||