<div dir="ltr">Hey Gunnar,<div><br></div><div>+1 for your proposal. I also think that this overriding scheme is sufficient and covers all the real world use cases.</div><div><br></div><div>Christian</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-20 18:57 GMT+01:00 Michael Nascimento <span dir="ltr">&lt;<a href="mailto:misterm@gmail.com" target="_blank">misterm@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Gunnar,<div><br></div><div>Agreed.</div><div><br></div><div>Regards,</div><div>Michael</div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 20, 2017 at 12:54 PM, Gunnar Morling <span dir="ltr">&lt;<a href="mailto:gunnar@hibernate.org" target="_blank">gunnar@hibernate.org</a>&gt;</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 think there already was agreement essentially that value extractors<br>
should be discoverable using the service loader mechanism.<br>
<br>
This will allow providers of custom collection types (e.g. Google<br>
Guava) to bundle a value extractor with their library and have it<br>
being picked up automatically, allowing application developer to put<br>
@Valid to these types without any further configuration.<br>
<br>
So I&#39;ve prepared a change for that:<br>
<br>
    <a href="https://github.com/beanvalidation/beanvalidation-spec/pull/140" rel="noreferrer" target="_blank">https://github.com/beanvalidat<wbr>ion/beanvalidation-spec/pull/<wbr>140</a><br>
<br>
The open question was how value extractors should be<br>
overridden/disabled. I&#39;ve foreseen the following sources for value<br>
extractors, in descending order of precedence:<br>
<br>
* ValidatorContext#addValueExtra<wbr>ctor(ValueExtractor&lt;?&gt;)<br>
* Configuration#addValueExtracto<wbr>r(ValueExtractor&lt;?&gt;)<br>
* META-INF/validation.xml<br>
* META-INF/services/javax.valida<wbr>tion.valueextraction.ValueExtr<wbr>actor<br>
<br>
If an extractor for a specific type (e.g. java.util.List) and type<br>
parameter (e.g. &quot;E&quot;) is given at one level (e.g. ValidatorContext) it<br>
will override any extractors for the same type and type parameter<br>
given at the lower levels and the built-in extractor for that type and<br>
type parameter, if any.<br>
<br>
I don&#39;t think there&#39;s a way needed to explicitly disable an extractor<br>
without providing an alternative implementation. I.e. I cannot see a<br>
use case why one would want to disable cascaded validation let&#39;s say<br>
for List. Hence the proposed overriding scheme.<br>
<br>
Can you please let me know what you think of this by the end of the week?<br>
<br>
Thanks,<br>
<br>
--Gunnar<br>
______________________________<wbr>_________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank">beanvalidation-dev@lists.jboss<wbr>.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/beanvalidation-dev</a><br>
</blockquote></div><br></div></div></div></div>
<br>______________________________<wbr>_________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div>Christian Kaltepoth</div><div>Blog: <a href="http://blog.kaltepoth.de/" target="_blank">http://blog.kaltepoth.de/</a></div><div>Twitter: <a href="http://twitter.com/chkal" target="_blank">http://twitter.com/chkal</a></div><div>GitHub: <a href="https://github.com/chkal" target="_blank">https://github.com/chkal</a></div><div><br></div></div>
</div>