DependenyChain removal

Skip to first unread message


Mar 12, 2021, 5:04:57 AM3/12/21
Can you please look at this issue?

> 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

Stuart McCulloch

Mar 14, 2021, 7:43:39 PM3/14/21
to google-guice
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}")

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
To view this discussion on the web visit
Reply all
Reply to author
0 new messages