Validation while Binding

I am facing problems while validating the form data in Vaadin 14 while binding the field with bean, I want to use some custom validation like :

  1. I want to validate fields using Regax in Java (Using Pattern & Matcher) while binding.
  2. Also the input data should be type safed, if form field allows only number and if user enters the Stirng then proper error message should be shown while binding.