class SimpleInjector extends Injector
A simple map backed injector.
This injector is intended for use by compile time injected applications in the transitional period between when Play fully supports dependency injection across the whole code base, and when some parts of Play still access core components through Play's global state. Since Play's global state requires that some components are still dynamically looked up from an injector, when using a compile time DI approach, there is typically no way to dynamically look up components, so this provides a simple implementation of the Injector trait to allow components that Play requires to be dynamically looked up.
It is intended to just hold built in Play components, but may be used to add additional components by end users when required.
The injector is an immutable structure, new components can be added using the +
convenience method, which returns
a new injector with that component included.
- Source
- Injector.scala
- Alphabetic
- By Inheritance
- SimpleInjector
- Injector
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+[T](component: T)(implicit ct: ClassTag[T]): SimpleInjector
Add a component to the injector.
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
add[T](clazz: Class[T], component: T): SimpleInjector
Add a component to the injector.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asJava: inject.Injector
Get as an instance of the Java injector.
Get as an instance of the Java injector.
- Definition Classes
- Injector
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
instanceOf[T](key: BindingKey[T]): T
Get an instance bound to the given binding key.
Get an instance bound to the given binding key.
- Definition Classes
- SimpleInjector → Injector
-
def
instanceOf[T](clazz: Class[T]): T
Get an instance of the given class from the injector.
Get an instance of the given class from the injector.
- Definition Classes
- SimpleInjector → Injector
-
def
instanceOf[T](implicit ct: ClassTag[T]): T
Get an instance of the given class from the injector.
Get an instance of the given class from the injector.
- Definition Classes
- SimpleInjector → Injector
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )