[cdi-dev] Injection with heritage and CDI

Otávio Gonçalves de Santana otaviopolianasantana at gmail.com
Sat Jul 8 10:10:58 EDT 2017


Hey, I have a question about heritage and CDI.
Given two interfaces:

   - Car interface
   - SportCar that extends Car


interface Car{}
interface SportCar extends Car{}

class DefaultCar implements Car {}

@FerrariQualifierclass DefaultSportCar implements SportCar {}

What I would like to inject:

@Injectprivate Car car; //inject DefaultCar

@Inject
@FerrariQualifierprivate Car ferrari; //inject DefaultSportCar


@Injectprivate SportCar sportCar;//inject DefaultSportCar



How can I do that?

-- 
Otávio Gonçalves de Santana


twitter: http://twitter.com/otaviojava
site:     *http://about.me/otaviojava <http://about.me/otaviojava>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20170708/da772ba5/attachment-0001.html 


More information about the cdi-dev mailing list