Using method references totally make sense. Yes, they are in Java 8. I don't know what "type" the method references are though; you'll have to check up on that.<br><br><div class="gmail_quote">On Mon, Oct 8, 2012 at 12:10 PM, Gunnar Morling <span dir="ltr"><<a href="mailto:gunnar@hibernate.org" target="_blank">gunnar@hibernate.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm not sure what's the current state regarding method references in<br>
Java 8. If they're in, we might make use of them for property<br>
validation:<br>
<br>
validator.validateProperty(car, Car::getManufacturer);<br>
validator.validateValue(Car::manufacturer, "Morris");<br>
<br>
Or if we add one day an API for programmatic constraint definition<br>
(example based on the API in HV):<br>
<br>
ConstraintMapping mapping = new ConstraintMapping();<br>
mapping.type( Car.class )<br>
.property( Car::getManufacturer" )<br>
.constraint( NotNull.class )<br>
.constraint( Size.class ).with( Size::min, 2).with( Size::max, 14 );<br>
<br>
That's just a quick thought, not sure whether that really works or<br>
makes too much sense, though.<br>
<br>
--Gunnar<br>
<br>
<br>
2012/10/8 Matt Benson <<a href="mailto:mbenson@apache.org">mbenson@apache.org</a>>:<br>
<div class="HOEnZb"><div class="h5">> That was my reaction as well, wondering whether anyone else would<br>
> propose any ways of augmenting the BV APIs to include<br>
> lambda-compatible interfaces.<br>
><br>
> Matt<br>
><br>
> On Mon, Oct 8, 2012 at 11:07 AM, Michael Nascimento <<a href="mailto:misterm@gmail.com">misterm@gmail.com</a>> wrote:<br>
>> Given there are no function types for now, I wonder what sort of<br>
>> impact could it have...<br>
>><br>
>> Regards,<br>
>> Michael<br>
>><br>
>> On Mon, Oct 8, 2012 at 8:59 AM, Emmanuel Bernard <<a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>> wrote:<br>
>>> How do you think Java 8 lambda expression support will affect Bean<br>
>>> Validation APIs? I have not thought about it yet but there might be<br>
>>> interesting possibilities.<br>
>>><br>
>>> <a href="https://hibernate.onjira.com/browse/BVAL-313" target="_blank">https://hibernate.onjira.com/browse/BVAL-313</a><br>
>>><br>
>>> Emmanuel<br>
>>> _______________________________________________<br>
>>> beanvalidation-dev mailing list<br>
>>> <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
>>> <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
>> _______________________________________________<br>
>> beanvalidation-dev mailing list<br>
>> <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
> _______________________________________________<br>
> beanvalidation-dev mailing list<br>
> <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
_______________________________________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
</div></div></blockquote></div><br>