fc.web.forms
Class VDate

java.lang.Object
  extended by fc.web.forms.FieldValidator
      extended by fc.web.forms.VDate

public final class VDate
extends FieldValidator

Validates a date.


Constructor Summary
VDate(AbstractText field, String errorMessage)
           
 
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 fc.web.forms.FieldValidator
getErrorMessage, getField
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VDate

public VDate(AbstractText field,
             String errorMessage)
Method Detail

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. The date string can be any valid string that is parseable by the java.text.DateFormat.parse(String) method (even if it's not semantically valid). For example, the following parses OK: 02/29/1980

Specified by:
validate in class FieldValidator
Throws:
ClassCastException - If the field's Field#getValue method does not return a String