org.apache.cocoon.forms.validation
Interface WidgetValidator

All Known Subinterfaces:
ConfigurableWidgetValidator
All Known Implementing Classes:
AbstractJavaValidator, CaptchaValidator, JavaScriptValidator, ValidationRuleValidator

public interface WidgetValidator

Validates a widget. Validation can mean lots of different things depending on the actual widget and validator type, e.g. :

  • A validator returns a boolean result indicating if validation was successful or not. If not successful, the validator must set a ValidationError on the validated widget or one of its children.

    Note: It is important (although it cannot be explicitely forbidden) that a validator does not consider widgets that are not the validated widgets itself or its children, as this may lead to inconsistencies in the form model because of the way form validation occurs (depth-first traversal of the widget tree).

    Version:
    $Id: WidgetValidator.html 1304280 2012-03-23 11:18:01Z ilgrosso $

    Method Summary
     boolean validate(Widget widget)
              Validate a widget.
     

    Method Detail

    validate

    public boolean validate(Widget widget)
    Validate a widget.

    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.


    Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.