I am extending Guice\'s AbstractModule
and inside of the extending class I need access to Guice\'s injector. It that possible, if yes, how?
You can inject the Injector
in your class or provider, but it should be used sparsely.
I found it here: https://groups.google.com/d/msg/google-guice/EiMDuDGei1Q/glxFhHKHHjsJ
See also: https://github.com/google/guice/wiki/InjectingTheInjector
public class MyClass
{
@Inject
public MyClass(Injector injector) { ... }
}
public class MyModule extends AbstractModule {
...
@Provides
public Something provideSomething(Injector injector) { ... }
}