org.apache.cocoon.woody.validation
Interface WidgetValidator

All Known Implementing Classes:
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:
    CVS $Id: WidgetValidator.html 1304258 2012-03-23 10:09:27Z ilgrosso $
    Author:
    Sylvain Wallez

    Method Summary
     boolean validate(Widget widget, FormContext context)
              Validate a widget.
     

    Method Detail

    validate

    boolean validate(Widget widget,
                     FormContext context)
    Validate a widget.

    Parameters:
    widget - the widget to validate
    context - the form context
    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-2010 The Apache Software Foundation. All Rights Reserved.