com.esri.adf.web.data.tasks.validator
Class DateValidator

java.lang.Object
  extended by com.esri.adf.web.data.tasks.validator.GenericValidator
      extended by com.esri.adf.web.data.tasks.validator.DateValidator
All Implemented Interfaces:
TaskParamValidator, Serializable

public class DateValidator
extends GenericValidator

This class is used to define the validation rules to be enforced on a Task parameter which is of type java.util.Date. The parameter is rendered as a textbox with a Javascript Calendar control to make it convenient for the user to specify a date and optionally a time.

 For Example,
   TaskParamDescriptor paramDescriptor = ...;
   DateValidator dateValidator = new DateValidator();
   dateValidator.setDateFormat(new SimpleDateFormat("dd MMMM yyyy"));
   dateValidator.setTimeFormat(new SimpleDateFormat("hh:mm:ss a"));
   paramDescriptor.setValidator(dateValidator);
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.esri.adf.web.data.tasks.validator.GenericValidator
ADFDOJOTYPE
 
Constructor Summary
DateValidator()
           
 
Method Summary
 SimpleDateFormat getDateFormat()
          Specifies the format that is used to display the date component.
 SimpleDateFormat getTimeFormat()
          Specifies the format that is used to display the time component.
 void setDateFormat(SimpleDateFormat dateFormat)
          Specifies the format that is used to display the date component.
 void setTimeFormat(SimpleDateFormat timeFormat)
          Specifies the format that is used to display the time component.
 
Methods inherited from class com.esri.adf.web.data.tasks.validator.GenericValidator
addValidationRule, getInvalidMessage, getPromptMessage, getValidationRules, isRequired, removeValidationRule, setInvalidMessage, setPromptMessage, setRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateValidator

public DateValidator()
Method Detail

getDateFormat

public SimpleDateFormat getDateFormat()
Specifies the format that is used to display the date component. By default, the format is null and the date is displayed using a 2 digit day, a 2 digit month, and a 4 digit year in the client browser's locale.

Returns:
the format to use.

getTimeFormat

public SimpleDateFormat getTimeFormat()
Specifies the format that is used to display the time component. By default, the format is null and the time component is not displayed.

Returns:
the format to use.

setDateFormat

public void setDateFormat(SimpleDateFormat dateFormat)
Specifies the format that is used to display the date component. By default, the format is null and the date is displayed using a 2 digit day, a 2 digit month, and a 4 digit year in the client browser's locale.
 For Example
   DateValidator dv = ...; 
   SimpleDateFormat sdf = new SimpleDateFormat("dd MMMM yyyy");
   dv.setDateFormat(sdf);
 

Parameters:
dateFormat - the format.
See Also:
SimpleDateFormat

setTimeFormat

public void setTimeFormat(SimpleDateFormat timeFormat)
Specifies the format that is used to display the time component. By default, the format is null and the time component is not displayed.
 For Example
   DateValidator dv = ...;
   SimpleDateFormat stf = new SimpleDateFormat("hh:mm:ss a");
   dv.setTimeFormat(stf);
 

Parameters:
timeFormat - the format.
See Also:
SimpleDateFormat