public interface Injector
newInstance
on the passed in class.
This abstraction is primarily provided for libraries that want to remain agnostic to the type of dependency
injection being used. End users are encouraged to use the facilities provided by the dependency injection framework
they are using directly, for example, if using Guice, use Injector
instead of this.Modifier and Type | Method and Description |
---|---|
<T> T |
instanceOf(play.api.inject.BindingKey<T> key)
Get an instance of the given class from the injector.
|
<T> T |
instanceOf(java.lang.Class<T> clazz)
Get an instance of the given class from the injector.
|
<T> T instanceOf(java.lang.Class<T> clazz)
clazz
- The class to get the instance of<T> T instanceOf(play.api.inject.BindingKey<T> key)
key
- The key of the binding