Class VEmail
java.lang.Object
fc.web.forms.FieldValidator
fc.web.forms.VEmail
Validates a email address
-
Constructor Summary
ConstructorsConstructorDescriptionVEmail(AbstractText field, String errorMessage) Constructs a new email validator that does not allow empty email address as validVEmail(AbstractText field, String errorMessage, boolean allowEmpty) Constructs a new email validator that allows an empty email address as valid if theallowEmptyargument istrue. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvalidate(FormData fd, HttpServletRequest req) Works with any field that returns a String via it'sAbstractText.getValue(FormData)method.Methods inherited from class FieldValidator
getErrorMessage, getField
-
Constructor Details
-
VEmail
Constructs a new email validator that does not allow empty email address as valid -
VEmail
Constructs a new email validator that allows an empty email address as valid if theallowEmptyargument istrue. This is useful for optional email fields.
-
-
Method Details
-
validate
Works with any field that returns a String via it'sAbstractText.getValue(FormData)method.- Specified by:
validatein classFieldValidator- Throws:
ClassCastException- If the field'sAbstractText.getValue(FormData)method does not return a String
-