org.apache.cocoon.forms.samples
Class CustomBirthDateValidator
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.forms.samples.CustomBirthDateValidator
- All Implemented Interfaces:
- LogEnabled, WidgetValidator
public class CustomBirthDateValidator
- extends AbstractLogEnabled
- implements WidgetValidator
Example of a custom validator. Check that the given date is a valid birth date, i.e.
is at least 5 years before current date and no more than 100 years old.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CustomBirthDateValidator
public CustomBirthDateValidator()
validate
public boolean validate(Widget widget)
- Description copied from interface:
WidgetValidator
- Validate a widget.
- Specified by:
validate
in interface WidgetValidator
- Parameters:
widget
- the widget to validate
- Returns:
true
if validation was successful. If not, the validator must have set
a ValidationError
on the widget or one of its children.- See Also:
WidgetValidator.validate(org.apache.cocoon.forms.formmodel.Widget)
Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.