From dca90d6e1683973332c31b685679d29eea7ff18f Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 14 Dec 2009 07:16:54 +0000 Subject: [PATCH] Document empty/required validation behvaior in javadoc (#3787). svn changeset:10268/svn branch:6.2 --- src/com/vaadin/ui/AbstractField.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/vaadin/ui/AbstractField.java b/src/com/vaadin/ui/AbstractField.java index 59b9497172..b45e73ab50 100644 --- a/src/com/vaadin/ui/AbstractField.java +++ b/src/com/vaadin/ui/AbstractField.java @@ -634,10 +634,13 @@ public abstract class AbstractField extends AbstractComponent implements Field, } /** - * Tests the current value against all registered validators. + * Tests the current value against registered validators if the field is not + * empty. If the field is empty it is considered valid if it is not required + * and invalid otherwise. Validators are never checked for empty fields. * * @return true if all registered validators claim that the - * current value is valid, false otherwise. + * current value is valid or if the field is empty and not required, + * false otherwise. */ public boolean isValid() { @@ -665,7 +668,8 @@ public abstract class AbstractField extends AbstractComponent implements Field, /** * Checks the validity of the Validatable by validating the field with all - * attached validators. + * attached validators except when the field is empty. An empty field is + * invalid if it is required and valid otherwise. * * The "required" validation is a built-in validation feature. If the field * is required, but empty, validation will throw an EmptyValueException with -- 2.39.5