summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/AbstractField.java
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-12-14 07:16:54 +0000
committerArtur Signell <artur.signell@itmill.com>2009-12-14 07:16:54 +0000
commitdca90d6e1683973332c31b685679d29eea7ff18f (patch)
tree179223c9d9f6b3b2c399da32a3c11e12a8c75a47 /src/com/vaadin/ui/AbstractField.java
parent8e34bda615bfcd97e738b78c6bd48dff50cc660a (diff)
downloadvaadin-framework-dca90d6e1683973332c31b685679d29eea7ff18f.tar.gz
vaadin-framework-dca90d6e1683973332c31b685679d29eea7ff18f.zip
Document empty/required validation behvaior in javadoc (#3787).
svn changeset:10268/svn branch:6.2
Diffstat (limited to 'src/com/vaadin/ui/AbstractField.java')
-rw-r--r--src/com/vaadin/ui/AbstractField.java10
1 files 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 <code>true</code> if all registered validators claim that the
- * current value is valid, <code>false</code> otherwise.
+ * current value is valid or if the field is empty and not required,
+ * <code>false</code> 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