Class

play.api.inject

SimpleInjector

Related Doc: package inject

Permalink

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
Linear Supertypes
Injector, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SimpleInjector
  2. Injector
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SimpleInjector(fallback: Injector, components: Map[Class[_], Any] = Map.empty)

    Permalink

    fallback

    The injector to fallback to if no component can be found.

    components

    The components that this injector provides.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +[T](component: T)(implicit ct: ClassTag[T]): SimpleInjector

    Permalink

    Add a component to the injector.

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def asJava: inject.Injector

    Permalink

    Get as an instance of the Java injector.

    Get as an instance of the Java injector.

    Definition Classes
    Injector
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. def instanceOf[T](key: BindingKey[T]): T

    Permalink

    Get an instance bound to the given binding key.

    Get an instance bound to the given binding key.

    Definition Classes
    SimpleInjectorInjector
  14. def instanceOf[T](clazz: Class[T]): T

    Permalink

    Get an instance of the given class from the injector.

    Get an instance of the given class from the injector.

    Definition Classes
    SimpleInjectorInjector
  15. def instanceOf[T](implicit ct: ClassTag[T]): T

    Permalink

    Get an instance of the given class from the injector.

    Get an instance of the given class from the injector.

    Definition Classes
    SimpleInjectorInjector
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Injector

Inherited from AnyRef

Inherited from Any

Ungrouped