aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/data/BeanBinder.java
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2016-08-25 14:53:09 +0300
committerArtur Signell <artur@vaadin.com>2016-09-02 15:13:19 +0300
commitccaabe6db025f7e73adc83b4d0e2671c7fa16d40 (patch)
treed1508def2ee24cac623616c1b4fdd29a6b8f069c /server/src/main/java/com/vaadin/data/BeanBinder.java
parent876b6383e6ec50a8bbe34126b7bfed5f6f616bea (diff)
downloadvaadin-framework-ccaabe6db025f7e73adc83b4d0e2671c7fa16d40.tar.gz
vaadin-framework-ccaabe6db025f7e73adc83b4d0e2671c7fa16d40.zip
Add item level validator support to Binder
An item level validator is run on the item (bean) after field validators have passed. A failed item level validator will block save operations, just like field level validators. Change-Id: I3b918b33371ceef07cdfbd0a8b6d477d4ac26b85
Diffstat (limited to 'server/src/main/java/com/vaadin/data/BeanBinder.java')
-rw-r--r--server/src/main/java/com/vaadin/data/BeanBinder.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/data/BeanBinder.java b/server/src/main/java/com/vaadin/data/BeanBinder.java
index 18985bc90c..63ad9ef04f 100644
--- a/server/src/main/java/com/vaadin/data/BeanBinder.java
+++ b/server/src/main/java/com/vaadin/data/BeanBinder.java
@@ -311,6 +311,11 @@ public class BeanBinder<BEAN> extends Binder<BEAN> {
}
@Override
+ public BeanBinder<BEAN> withValidator(Validator<? super BEAN> validator) {
+ return (BeanBinder<BEAN>) super.withValidator(validator);
+ }
+
+ @Override
protected <FIELDVALUE, TARGET> BeanBindingImpl<BEAN, FIELDVALUE, TARGET> createBinding(
HasValue<FIELDVALUE> field, Converter<FIELDVALUE, TARGET> converter,
StatusChangeHandler handler) {
@@ -318,4 +323,5 @@ public class BeanBinder<BEAN> extends Binder<BEAN> {
Objects.requireNonNull(converter, "converter cannot be null");
return new BeanBindingImpl<>(this, field, converter, handler);
}
+
}