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).

    CVS $Id: WidgetValidator.html 1304258 2012-03-23 10:09:27Z ilgrosso $
    Sylvain Wallez

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

    Method Detail


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

    widget - the widget to validate
    context - the form context
    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.