|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object velosurf.validation.FieldConstraint velosurf.validation.EmailCheck
public class EmailCheck
An 'email' constraint. Syntax is:
<column type="email"/>
Or:
<column> <email [dns-check="true | false"] [smtp-check="true | false" ] [message="error-message"]> </column>
Nested Class Summary | |
---|---|
(package private) class |
EmailCheck.FastTimeoutConnect
A socket with short timeout. |
Field Summary | |
---|---|
private boolean |
dnsCheck
whether to check dns. |
private boolean |
smtpCheck
whether to check smtp server. |
private static java.util.regex.Pattern |
validEmail
valid email pattern. |
Constructor Summary | |
---|---|
EmailCheck()
Default constructor. |
|
EmailCheck(boolean dnsCheck,
boolean smtpCheck)
Constructor. |
Method Summary | |
---|---|
private boolean |
checkSMTP(java.lang.String user,
java.lang.String hostname)
Check SMTP server. |
java.lang.String |
toString()
return a string representation for this constraint. |
boolean |
validate(java.lang.Object data)
Validate data against this constraint. |
Methods inherited from class velosurf.validation.FieldConstraint |
---|
getMessage, setMessage, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private boolean dnsCheck
private boolean smtpCheck
private static java.util.regex.Pattern validEmail
Constructor Detail |
---|
public EmailCheck()
public EmailCheck(boolean dnsCheck, boolean smtpCheck)
dnsCheck
- whether to validate this email using a DNS querysmtpCheck
- whether to validate this email using an STMP queryMethod Detail |
---|
public boolean validate(java.lang.Object data)
validate
in class FieldConstraint
data
- data to validate
private boolean checkSMTP(java.lang.String user, java.lang.String hostname)
user
- usernamehostname
- hostname
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |