01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08:
09: package com.gwtext.client.widgets.form;
10:
11: /**
12: * Interface that must be implemented for custom Field validation logic.
13: *
14: * @see com.gwtext.client.widgets.form.TextField#setValidator(Validator)
15: */
16: public interface Validator {
17: /**
18: * Return true if Field value is valid and false if invalid. The value set in {@link Field#setInvalidText(String)}
19: * will be used as the error message. For a custom error message throw a ValidationException with the
20: * error message. The error message of the ValidationException will be dispalyed.
21: *
22: *
23: * @param value the field value to test
24: * @return true if valid, false if invalid.
25: * @throws ValidationException when validate fails
26: */
27: boolean validate(String value) throws ValidationException;
28: }
|