<div dir="ltr">Hi,<div><br></div><div>Annotation builder would be +1. It's a tiny bit less convenient, but more universal. So better for the spec.</div><div><br></div><div>Convenience addition could theoretically still be:<br><br><span style="font-size:12.8px">Set<Bean<?>> getBeans(Type beanType, Class<?> annotationType, Object... annotation attributes);</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">But... I acknowledge that this would again be for a more specific situation (namely, a bean with exactly 1 qualifier and 0 or more binding attributes).</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">While on the subject, it's currently not possible for an injected bean to get hold of the annotation instance that's used in CDI.current().select(), BeanManager.getBeans, etc, is it?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Kind regards,</span></div><div><span style="font-size:12.8px">Arjan Tijms</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 12, 2016 at 1:44 PM, Martin Kouba <span dir="ltr"><<a href="mailto:mkouba@redhat.com" target="_blank">mkouba@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Type safety is not guaranteed in the current version of AnnotationInstanceProvider (deltaspike). We should at least check the provided map of member values against the set of declared methods. Otherwise, I like the idea of standardizing a similar "annotation instance builder".<br>
<br>
Martin<br>
<br>
Dne 12.9.2016 v 12:34 Romain Manni-Bucau napsal(a):<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Think it is maybe saner to have AnnotationProvider.of(type, params)<br>
(like in deltaspike) since it doesnt leave the parameterized annotations<br>
(which are not rare) next the road.<br>
<br>
<br>
Romain Manni-Bucau<br></span>
@rmannibucau <<a href="https://twitter.com/rmannibucau" rel="noreferrer" target="_blank">https://twitter.com/rmannibuc<wbr>au</a>> | Blog<br>
<<a href="https://blog-rmannibucau.rhcloud.com" rel="noreferrer" target="_blank">https://blog-rmannibucau.rhcl<wbr>oud.com</a>> | Old Wordpress Blog<br>
<<a href="http://rmannibucau.wordpress.com" rel="noreferrer" target="_blank">http://rmannibucau.wordpress.<wbr>com</a>> | Github<br>
<<a href="https://github.com/rmannibucau" rel="noreferrer" target="_blank">https://github.com/rmannibuca<wbr>u</a>> | LinkedIn<br>
<<a href="https://www.linkedin.com/in/rmannibucau" rel="noreferrer" target="_blank">https://www.linkedin.com/in/r<wbr>mannibucau</a>> | Tomitriber<br>
<<a href="http://www.tomitribe.com" rel="noreferrer" target="_blank">http://www.tomitribe.com</a>> | JavaEE Factory<br>
<<a href="https://javaeefactory-rmannibucau.rhcloud.com" rel="noreferrer" target="_blank">https://javaeefactory-rmannib<wbr>ucau.rhcloud.com</a>><span class=""><br>
<br>
2016-09-12 12:28 GMT+02:00 arjan tijms <<a href="mailto:arjan.tijms@gmail.com" target="_blank">arjan.tijms@gmail.com</a><br></span>
<mailto:<a href="mailto:arjan.tijms@gmail.com" target="_blank">arjan.tijms@gmail.com</a>><wbr>>:<span class=""><br>
<br>
Hi,<br>
<br>
Wouldn't it be convenient as the CDI API that now requires an<br>
Annotation instance in various APIs, would also accept the class<br>
type of that Annotation?<br>
<br>
E.g. in BeanManager there's this method:<br>
<br>
Set<Bean<?>> getBeans(Type beanType, Annotation... qualifiers)<br>
<br>
This not rarely requires one to create an AnnotationLiteral, which<br>
is not specifically difficult but a tad verbose. For qualifiers that<br>
have no (binding) attributes, a simple Class would be much easier to<br>
use.<br>
<br>
Thoughts?<br>
<br>
Kind regards,<br>
Arjan Tijms<br>
<br>
______________________________<wbr>_________________<br>
cdi-dev mailing list<br></span>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a> <mailto:<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.or<wbr>g</a>><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/cdi-dev</a><span class=""><br>
<<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailm<wbr>an/listinfo/cdi-dev</a>><br>
<br>
Note that for all code provided on this list, the provider licenses<br>
the code under the Apache License, Version 2<br>
(<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/license<wbr>s/LICENSE-2.0.html</a><br></span>
<<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/license<wbr>s/LICENSE-2.0.html</a>>). For all other<span class=""><br>
ideas provided on this list, the provider waives all patent and<br>
other intellectual property rights inherent in such information.<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/license<wbr>s/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
<br>
</span></blockquote>
</blockquote></div><br></div>