Package org.webharvest.ioc
Class InjectorHelper
- java.lang.Object
-
- org.webharvest.ioc.InjectorHelper
-
public final class InjectorHelper extends Object
Guice static injector helper. This class is handy when it comes to get reference to Guice'sInjector
for a class that is not managed or instantiated by Guice (eg. legacy code or Guice module type listener classes). Please do not overuse it as its a kind of trick rather then good approach to codding style.public class MyModule extends AbstractModule { protected void configure() { // (...) requestStaticInjection(InjectorHelper.class); // (...) } }
- Since:
- 2.1.0-SNAPSHOT
- Author:
- Robert Bala, Piotr Dyraga
- See Also:
Injector
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.inject.Injector
getInjector()
Gets reference to the currentInjector
.
-