public final class ERXEmailValidator
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
ERXEmailValidator(boolean allowQuotedIdentifiers,
boolean allowDomainLiterals) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
hostNameForEmailString(java.lang.String email)
Parses the host name from the email string
|
static java.lang.Boolean |
isValidDomainString(java.lang.String hostName,
long timeout)
Deprecated.
this method will throw mysterious NullPointerExceptions if used
in a loop. Evidently, something about the DirContext is not as thread safe
as the javadocs claim. Do not use it.
|
boolean |
isValidEmailAddress(java.lang.String email,
long timeout,
boolean def)
Deprecated.
Deprecated because it relies on
ERXEmailValidator#isValidDomainString(String, long) |
boolean |
isValidEmailString(java.lang.String email)
Utility method that checks to see if the specified string is a valid
email address according to the * RFC 2822 specification.
|
public ERXEmailValidator(boolean allowQuotedIdentifiers,
boolean allowDomainLiterals)
allowQuotedIdentifiers - if true, quoted identifiers are allowed (using quotes and
angle brackets around the raw address) are allowed, e.g.:
"John Smith" <john.smith@somewhere.com> The RFC says
this is a valid mailbox. If you don't want to allow this,
because for example, you only want users to enter in a raw
address (john.smith@somewhere.com - no quotes or angle
brackets), then set this to false.allowDomainLiterals - if true, domain literals are allowed in the email address,
e.g.: someone@[192.168.1.100] or john.doe@[23:33:A2:22:16:1F]
or me@[my computer] The RFC says these are valid email
addresses, but most people don't like allowing them. If you
don't want to allow them, and only want to allow valid domain
names (RFC 1035, x.y.z.com, etc), set this to false.public boolean isValidEmailString(java.lang.String email)
email - the email address string to test for validity.public static java.lang.Boolean isValidDomainString(java.lang.String hostName,
long timeout)
hostName - the email hostNametimeout - the timeout in millisecondsjavax.naming.NamingExceptionpublic boolean isValidEmailAddress(java.lang.String email,
long timeout,
boolean def)
ERXEmailValidator#isValidDomainString(String, long)email - the email string to testtimeout - the timeout in millisecondsdef - default value if timeout occurspublic static java.lang.String hostNameForEmailString(java.lang.String email)
email - the email addressCopyright © 2002 – 2022 Project Wonder.