-
1. Re: Is it an oversight that ObserverMethod doesn't have getInjectionPoints()?
manovotn Apr 25, 2019 3:57 AM (in response to ljnelson)Hi,
the ability to have injection point has been there since forever (it was possible even in 1.0) yet the option you are asking for is lacking. I certainly haven't been there when/is the design decision was taken
Javadoc of InjectionPoint even mentions that it can be a parameter of an Observer method.
I'd say what you ask is a feature request material for CDI spec.
Not sure how user friendly would be any solution on Weld side, we could probably have something like WeldProcessObserverMethod lifecycle event with a method returning it but that's hardly friendlier than just going over the params as you suggested.
Also note that Producer#getInjectionPoints() is really only good for browsing them as you cannot swap them out with another. At that point, they are only used for validation purposes.
-
2. Re: Is it an oversight that ObserverMethod doesn't have getInjectionPoints()?
manovotn Apr 25, 2019 4:01 AM (in response to manovotn)Actually, our implementation already has the very method you are after, so if you would be fine doing some casting, be our guest.
core/ObserverMethodImpl.java at 3.1.0.Final · weld/core · GitHub