One alternative is to use the binding SPI to look over the dependencies of all registered bindings and add additional bindings as appropriate. However this will only work for types that are explicitly bound before the injector is created, it won't work for just-in-time requests. It also relies on you wrapping a module around the application modules to kick off the analysis. It is feasible though - I've used this to provide annotation-driven property-placeholders such as @Named("${expression}")
On Fri, 12 Mar 2021 at 10:04, 'd3coder' via google-guice < google-guice@googlegroups.com> wrote: > Can you please look at this issue? > https://github.com/google/guice/issues/1121 > > > The provided example to replace the deprecated dependency chain method > doesn't provide enough context about which field or parameter is being > injected. I tried to replace dependency chain method, but the most > accurate I > got was knowing which method/constructor/class is being injected. > > > Knowing which field/parameter is being injected allowed Providers to > return > values based on the annotated elements, without having to bind each > possible > combination. > > > -- > You received this message because you are subscribed to the Google Groups > "google-guice" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to google-guice+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-guice/1763681.PJ3cxWoS9r%40arch. > -- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/CAMr6Z4mc0BiuihkF1XSBQ89LkMG9OFgU9s29Q5p00wm2rCyHmg%40mail.gmail.com.