<div dir="ltr"><div><br></div><div>Hey, I have a question about heritage and CDI.</div><div>Given two interfaces: </div><div><ul><li>Car interface<br></li><li>SportCar that extends Car<br></li></ul></div><div><br></div><div><pre style="color:rgb(0,0,0);background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"><span style="color:rgb(128,0,0);font-weight:bold">interface</span> Car<span style="color:rgb(128,0,128)">{</span>
<span style="color:rgb(128,0,128)">}</span>
<span style="color:rgb(128,0,0);font-weight:bold">interface</span> SportCar <span style="color:rgb(128,0,0);font-weight:bold">extends</span> Car<span style="color:rgb(128,0,128)">{</span>
<span style="color:rgb(128,0,128)">}</span>
<span style="color:rgb(128,0,0);font-weight:bold">class</span> DefaultCar <span style="color:rgb(128,0,0);font-weight:bold">implements</span> Car <span style="color:rgb(128,0,128)">{</span>
<span style="color:rgb(128,0,128)">}</span>
@FerrariQualifier
<span style="color:rgb(128,0,0);font-weight:bold">class</span> DefaultSportCar <span style="color:rgb(128,0,0);font-weight:bold">implements</span> SportCar <span style="color:rgb(128,0,128)">{</span>
<span style="color:rgb(128,0,128)">}</span>
What I would like to inject:
@Inject
<span style="color:rgb(128,0,0);font-weight:bold">private</span> Car car<span style="color:rgb(128,128,48)">;</span> <span style="color:rgb(105,105,105)">//inject DefaultCar</span>
@Inject
@FerrariQualifier
<span style="color:rgb(128,0,0);font-weight:bold">private</span> Car ferrari<span style="color:rgb(128,128,48)">;</span> <span style="color:rgb(105,105,105)">//inject DefaultSportCar</span>
@Inject
<span style="color:rgb(128,0,0);font-weight:bold">private</span> SportCar sportCar<span style="color:rgb(128,128,48)">;</span><span style="color:rgb(105,105,105)">//inject DefaultSportCar</span></pre></div><div><br></div><div><br></div><div>How can I do that?</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Otávio Gonçalves de Santana<div><div style="text-align:center"><br><div style="text-align:left"><br></div><div style="text-align:left">twitter: <a href="http://twitter.com/otaviojava" target="_blank">http://twitter.com/otaviojava</a></div><div style="text-align:left">site: <span style="text-align:center"><font color="#0000ee"><u><a href="http://about.me/otaviojava" target="_blank">http://about.me/otaviojava</a></u></font></span></div><div style="text-align:-webkit-auto"><br></div></div></div></div></div></div></div></div>
</div>