Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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. :

- on fields, a validator will validate the field's value,
  on repeaters, a validator can perform inter-row validation

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.java 587759 2007-10-24 03:00:37Z vgritsenko $

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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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