aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/data/StatusChangeEvent.java
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2017-02-03 13:40:54 +0200
committerPekka Hyvönen <pekka@vaadin.com>2017-02-03 13:40:54 +0200
commit560d1615408b0ff85439f891c0bb32c84807bd3e (patch)
treee817140ea7bed012b1e773493e10cb76e7472d13 /server/src/main/java/com/vaadin/data/StatusChangeEvent.java
parent0a325d95a588010a6d5c511afddb8db8048d50ee (diff)
downloadvaadin-framework-560d1615408b0ff85439f891c0bb32c84807bd3e.tar.gz
vaadin-framework-560d1615408b0ff85439f891c0bb32c84807bd3e.zip
Add isValid to Binder (#8274)
* Add isValid to Binder isValid enables you to check the current validation status of a given Binder, without firing events or invoking handlers. This patch also clarifies the javadocs of StatusChangeEvents' hasValidationErrors. * Throw in Binder.isValid if no bean is set and bean validators exist * Add test cases to BinderTest
Diffstat (limited to 'server/src/main/java/com/vaadin/data/StatusChangeEvent.java')
-rw-r--r--server/src/main/java/com/vaadin/data/StatusChangeEvent.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/server/src/main/java/com/vaadin/data/StatusChangeEvent.java b/server/src/main/java/com/vaadin/data/StatusChangeEvent.java
index e4db2b8868..acef1bac75 100644
--- a/server/src/main/java/com/vaadin/data/StatusChangeEvent.java
+++ b/server/src/main/java/com/vaadin/data/StatusChangeEvent.java
@@ -26,7 +26,7 @@ import com.vaadin.server.Setter;
* <p>
* The {@link Binder} status is changed whenever any of the following happens:
* <ul>
- * <li>if it's bound and any of its bound field or select has been changed
+ * <li>if any of its bound fields or selects have been changed
* <li>{@link Binder#writeBean(Object)} or
* {@link Binder#writeBeanIfValid(Object)} is called
* <li>{@link Binder#readBean(Object)} is called
@@ -47,13 +47,14 @@ public class StatusChangeEvent extends EventObject {
private final boolean hasValidationErrors;
/**
- * Create a new status change event for given {@code binder} using its
- * current validation status.
+ * Create a new status change event for given {@code binder}, storing
+ * information of whether the change that triggered this event caused
+ * validation errors.
*
* @param binder
* the event source binder
* @param hasValidationErrors
- * the binder validation status
+ * the validation status associated with this event
*/
public StatusChangeEvent(Binder<?> binder, boolean hasValidationErrors) {
super(binder);
@@ -61,10 +62,10 @@ public class StatusChangeEvent extends EventObject {
}
/**
- * Gets the binder validation status.
+ * Gets the associated validation status.
*
- * @return {@code true} if the binder has validation errors, {@code false}
- * otherwise
+ * @return {@code true} if the change that triggered this event caused
+ * validation errors, {@code false} otherwise
*/
public boolean hasValidationErrors() {
return hasValidationErrors;