[bv-dev] Feedback for BVAL-214
hendrik.ebbers at me.com
Thu Sep 1 07:02:53 EDT 2016
I had a deeper look at BVAL-214 (http://beanvalidation.org/proposals/BVAL-214/) and have some additional input. Since we depend on java 8 I think it would make sense to use suppliers to create the bean mocks for validation. This can look like this:
BeanValidator<ContactDataModel> contactValidator = BeanValidator.build(ContactDataModel.class);
contactValidator.withProperty("city", () -> cityField.getText()).
withProperty("zipCode", () -> zipCodeField.getText());
In addition I think that it will be important to have a better feedback for the violations that are based on a UI field. If you have a violation based in the text of the cityField you normally want to mark that field in the UI. I think a consumer can really help here:
contactValidator.withProperty("city", () -> cityField.getText(), v -> markCityField(v));
By doing so you will always get the set of violations that is based on the value in the city field.
You can find a first idea of such an interface and 2 view controller examples here: https://github.com/guigarage/validation-playground/tree/master/src/main/java/com/guigarage/dynamicvalidation
> Am 01.09.2016 um 10:14 schrieb Gunnar Morling <gunnar at hibernate.org>:
> Unfortunately I won't be able to attend JavaOne myself, but still it should be a great opportunity for members of the BV EG and community to meet and exchange.
> As per  there is a BV 2.0 Hackergarten event scheduled for Tuesday the 20th, led by Michael Nascimento. Thanks for taking this initiative, Michael!
> Interesting things to discuss and explore might be proposals written by then (e.g. the one around List<@Email>, Emmanuel is working on updating this one) and things like ordering of constraints (BVAL-248, ) or David Blevins' proposal around using Lambdas (BVAL-515, ). David should be there, so make sure to get hold of him :)
> Another interesting topic is integration with other specs/techs (e.g. javax.money or JavaFX). Specifically, there are several pending issues around the integration of BV and JAX-RS:
> * Provides means to disable BV during JAX-RS lifecycle validation (BVAL-520, )
> * Provide facility for more flexible HTTP error codes when using BV with JAX-RS (BVAL-518, )
> * Pass the request locale to BV's MessageInterpolator
> Mostly these things would have to be done on the JAX-RS side, so it would be great to have a chat with them if there is the chance for it.
> Apart from that, essentially anything would be great which helps with forming a picture of the community's needs and requirements.
>  http://linkis.com/community.oracle.com/bhe4K <http://linkis.com/community.oracle.com/bhe4K>
>  https://hibernate.atlassian.net/browse/BVAL-248 <https://hibernate.atlassian.net/browse/BVAL-248>
>  https://hibernate.atlassian.net/browse/BVAL-515 <https://hibernate.atlassian.net/browse/BVAL-515>
>  https://hibernate.atlassian.net/browse/BVAL-520 <https://hibernate.atlassian.net/browse/BVAL-520>
>  https://hibernate.atlassian.net/browse/BVAL-518 <https://hibernate.atlassian.net/browse/BVAL-518>
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the beanvalidation-dev