diff options
author | Tatu Lund <tatu@vaadin.com> | 2019-11-12 12:27:56 +0200 |
---|---|---|
committer | Anna Koskinen <Ansku@users.noreply.github.com> | 2019-11-12 12:27:56 +0200 |
commit | 9d03f9944482f33ed3c22f91ccd7d9cbea95fdaa (patch) | |
tree | b83496fc2ae4d5cfa713d1a9e5c92dcea191f7d5 | |
parent | dc35fdec074e14a09b8efb82ce1068338bac155d (diff) | |
download | vaadin-framework-9d03f9944482f33ed3c22f91ccd7d9cbea95fdaa.tar.gz vaadin-framework-9d03f9944482f33ed3c22f91ccd7d9cbea95fdaa.zip |
Added missing constructor with scanNestedDefinitions option (#11801)
* Added missing constructor with scanNestedDefinitions option
Addresses https://github.com/vaadin/framework/issues/10949
-rw-r--r-- | server/src/main/java/com/vaadin/data/BeanValidationBinder.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/data/BeanValidationBinder.java b/server/src/main/java/com/vaadin/data/BeanValidationBinder.java index e98ce96b37..de67f922bf 100644 --- a/server/src/main/java/com/vaadin/data/BeanValidationBinder.java +++ b/server/src/main/java/com/vaadin/data/BeanValidationBinder.java @@ -49,7 +49,25 @@ public class BeanValidationBinder<BEAN> extends Binder<BEAN> { * the bean type to use, not <code>null</code> */ public BeanValidationBinder(Class<BEAN> beanType) { - super(beanType); + this(beanType,false); + } + + /** + * Creates a new binder that uses reflection based on the provided bean type + * to resolve bean properties. It assumes that JSR-303 bean validation + * implementation is present on the classpath. If there is no such + * implementation available then {@link Binder} class should be used instead + * (this constructor will throw an exception). Otherwise + * {@link BeanValidator} is added to each binding that is defined using a + * property name. + * + * @param beanType + * the bean type to use, not {@code null} + * @param scanNestedDefinitions + * if {@code true}, scan for nested property definitions as well + */ + public BeanValidationBinder(Class<BEAN> beanType, boolean scanNestedDefinitions) { + super(beanType, scanNestedDefinitions); if (!BeanUtil.checkBeanValidationAvailable()) { throw new IllegalStateException(BeanValidationBinder.class .getSimpleName() |