<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div>CDI supports producer methods which accept the InjectionPoint as argument which allows to access all metadata to the injection point. The InjectionPoint approach adds a certain complexity which is not needed when only qualifier metadata has to be processed. I propose to allow annotation types within the producer method signatures. Code example for a use case:&nbsp;</div><div><br></div><div>{code}</div><div>@HttpParam("username") @Inject String username</div><div>{code}</div><div><br></div><div>{code}</div><div>import javax.enterprise.inject.Produces;</div><div>import javax.enterprise.inject.spi.InjectionPoint;</div><div><br></div><div>class HttpParams</div><div>&nbsp; &nbsp;@Produces</div><div><br></div><div>&nbsp; &nbsp;String getParamValue(HttpParam httpParam) {</div><div><br></div><div>&nbsp; &nbsp; &nbsp; ServletRequest request = (ServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;</div><div>&nbsp; &nbsp; &nbsp; return request.getParameter(httpParam.value());</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;</div><div>&nbsp; &nbsp; &nbsp; // current support looks like:</div><div>&nbsp; &nbsp; &nbsp; // String getParamValue(InjectionPoint ip) {</div><div>&nbsp; &nbsp; &nbsp; // return request.getParameter(ip.getAnnotated().getAnnotation(HttpParam.class).value());</div><div><br></div><div>&nbsp; &nbsp;}</div><div>}</div><div>{code}</div><div><br></div><div>Producer methods accepting qualifier annotations ensure to have always an annotation instance, this helps to prevent null pointer access since InjectionPoint.getAnnotated().getAnnotation(java.lang.Class&lt;T&gt;) may return null.</div></div><div><br></div><div>Best regards, Mark</div><div><br></div><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px; "><div style="direction: ltr; "><font face="Courier"><div style="direction: ltr; ">--</div><div style="direction: ltr; "><br></div><div style="direction: ltr; ">PALUCH.biz</div><div style="direction: ltr; ">Heckenpfad 14 // 69469 Weinheim</div><div style="direction: ltr; ">T. 0 62 01/65 04 24-0 // F. 0 62 01/65 04 24-9</div><div style="direction: ltr; "><a href="mailto:mpaluch@paluch.biz">mpaluch@paluch.biz</a></div><div style="direction: ltr; "><a href="http://www.paluch.biz">http://www.paluch.biz</a></div></font></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></div>
</div>
<br></body></html>