fc.web.forms
Class VEmail
java.lang.Object
fc.web.forms.FieldValidator
fc.web.forms.VEmail
public final class VEmail
- extends FieldValidator
Validates a email address
Constructor Summary |
VEmail(AbstractText field,
java.lang.String errorMessage)
Constructs a new email validator that does not allow empty
email address as valid |
VEmail(AbstractText field,
java.lang.String errorMessage,
boolean allowEmpty)
Constructs a new email validator that allows an empty email
address as valid if the allowEmpty argument is
true. |
Method Summary |
boolean |
validate(FormData fd,
javax.servlet.http.HttpServletRequest req)
Works with any field that returns a String via it's Field#getValue method. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VEmail
public VEmail(AbstractText field,
java.lang.String errorMessage)
- Constructs a new email validator that does not allow empty
email address as valid
VEmail
public VEmail(AbstractText field,
java.lang.String errorMessage,
boolean allowEmpty)
- Constructs a new email validator that allows an empty email
address as valid if the allowEmpty argument is
true. This is useful for optional email fields.
validate
public boolean validate(FormData fd,
javax.servlet.http.HttpServletRequest req)
- Works with any field that returns a String via it's
Field#getValue
method.
- Specified by:
validate
in class FieldValidator
- Throws:
java.lang.ClassCastException
- If the field's Field#getValue
method
does not return a String