-
1. Re: Programmatic Lookup with AnnotationLiteral, @Produces and InjectionPoint, how?
ahhughes Feb 9, 2012 11:50 PM (in response to ahhughes)I have just (attempted) to create a junit+arquillian test for this (but arquillian is having some problems in relation to dependency setup) NOTE: I have tried to simplify the example... if you submit "Marco" to the producer, it should return "Polo" and vice-a-versa https://github.com/ahhughes/cdi-programmatic-lookup-with-runtime-qualifier-value-test
-
2. Re: Programmatic Lookup with AnnotationLiteral, @Produces and InjectionPoint, how?
pmuir Feb 10, 2012 5:39 AM (in response to ahhughes)What versions are you using? This should work.
-
3. Re: Programmatic Lookup with AnnotationLiteral, @Produces and InjectionPoint, how?
ahhughes Feb 10, 2012 6:30 PM (in response to pmuir)Thanks Pete, very important to know that this should work the version I am currently using is 1.1.5.FINAL
(need to fix arquilian profile in my test, but this confirms 1.1.5.FINAL https://github.com/ahhughes/cdi-programmatic-lookup-with-runtime-qualifier-value-test/blob/master/pom.xml#L13)
THANKS SO FAR, seems promising
-
4. Re: Programmatic Lookup with AnnotationLiteral, @Produces and InjectionPoint, how?
jharting Feb 13, 2012 7:17 AM (in response to ahhughes)This is wrong. You cannot expect the annotation to be reflected within the low-level representation of the Instance-injected field (AnnotatedField). You should be able to get the information you want using InjectionPoint.getQualifiers().
-
5. Re: Programmatic Lookup with AnnotationLiteral, @Produces and InjectionPoint, how?
ahhughes Feb 15, 2012 5:40 AM (in response to jharting)Thanks very much Jozef, you are correct this does work! Once I have arquillian working properly I can proove it on github
Use... injectionPoint.getQualifiers() not injectionPoint.getAnnotated()
Thanks very much, without your help I was about to give up!