Class BeanValidationBinder<BEAN>

java.lang.Object
com.vaadin.flow.data.binder.Binder<BEAN>
com.vaadin.flow.data.binder.BeanValidationBinder<BEAN>
Type Parameters:
BEAN - the bean type
All Implemented Interfaces:
Serializable

public class BeanValidationBinder<BEAN> extends Binder<BEAN>
Binder that uses reflection based on the provided bean type to resolve bean properties. The Binder automatically adds BeanValidator which validates beans using JSR-303 specification. It assumes that JSR-303 bean validation implementation is present on the classpath.
Since:
1.0
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • BeanValidationBinder

      public BeanValidationBinder(Class<BEAN> beanType)
      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 Binder class should be used instead (this constructor will throw an exception). Otherwise BeanValidator is added to each binding that is defined using a property name.
      Parameters:
      beanType - the bean type to use, not null
    • BeanValidationBinder

      public BeanValidationBinder(Class<BEAN> beanType, boolean scanNestedDefinitions)
      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 Binder class should be used instead (this constructor will throw an exception). Otherwise BeanValidator is added to each binding that is defined using a property name.
      Parameters:
      beanType - the bean type to use, not null
      scanNestedDefinitions - if true, scan for nested property definitions as well
  • Method Details