codingwell / scala-guice

Scala extensions for Google Guice
Apache License 2.0
341 stars 44 forks source link

Is there any scala-guice implementation for Custom Injections? #101

Closed Daniel-Khodabakhsh closed 2 years ago

Daniel-Khodabakhsh commented 2 years ago

Guice supports Custom Injections, where a TypeListener is implemented, and then either MembersInjectors or InjectionListeners is registered.

This feature allows us to effectively create a provider which has more information on the class it's injecting into (such as in the case where a logger is created, and a logger tied to the class is given to that class).

Does scala-guice have any shortcuts for creating these custom injections?

Daniel-Khodabakhsh commented 2 years ago

The answer is no. Use classic bindListener for custom injections.