Class/Object

com.twitter.inject

Injector

Related Docs: object Injector | package inject

Permalink

abstract class Injector extends AnyRef

An injector used within Finatra.

This is abstract class to allow for two implementations:

- production injector, created via Injector.apply and - test injector, created via TestInjector.apply

DO NOT EXTEND this class on your own.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Injector
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Injector()

    Permalink
    Attributes
    protected[com.twitter.inject]

Abstract Value Members

  1. abstract def instance[T](key: Key[T]): T

    Permalink

    Returns the appropriate instance for the given injection key.

    Returns the appropriate instance for the given injection key.

    When feasible, avoid using this method in favor of having the Injector inject your dependencies ahead of time via annotating your constructor with @Inject.

    T

    type of the bound instance to return from the object graph.

    key

    com.google.inject.Key binding key of the bound instance to return from the object graph.

    returns

    bound instance of type T represented by com.google.inject.Key key.

    See also

    com.google.inject.Key

  2. abstract def instance[T, Ann <: Annotation](clazz: Class[T], annotationClazz: Class[Ann]): T

    Permalink

    Returns the appropriate instance for the given key constructed from the passed class and given java.lang.annotation.Annotation class.

    Returns the appropriate instance for the given key constructed from the passed class and given java.lang.annotation.Annotation class.

    T

    type of the bound instance to return from the object graph.

    Ann

    type of the annotation class used to disambiguate the bound type T.

    clazz

    the class of type T of the bound instance to return from the object graph.

    annotationClazz

    java.lang.annotation.Annotation class used to disambiguate the bound type T.

    returns

    bound instance of type T.

  3. abstract def instance[T](clazz: Class[T], annotation: Annotation): T

    Permalink

    Returns the appropriate instance for the given key constructed from the passed class and given java.lang.annotation.Annotation annotation.

    Returns the appropriate instance for the given key constructed from the passed class and given java.lang.annotation.Annotation annotation.

    When feasible, avoid using this method, in favor of having the Injector inject your dependencies ahead of time via annotating your constructor with @Inject.

    T

    type of the bound instance to return from the object graph.

    clazz

    the class of type T of the bound instance to return from the object graph.

    annotation

    java.lang.annotation.Annotation instance used to disambiguate the bound type T.

    returns

    bound instance of type T.

  4. abstract def instance[T](clazz: Class[T]): T

    Permalink

    Returns the appropriate instance for the given injection type.

    Returns the appropriate instance for the given injection type.

    When feasible, avoid using this method, in favor of having the Injector inject your dependencies ahead of time via annotating your constructor with @Inject.

    T

    type of the bound instance to return from the object graph.

    clazz

    the class of type T of the bound instance to return from the object graph.

    returns

    bound instance of type T.

  5. abstract def instance[T](annotationClazz: Class[_ <: Annotation])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T

    Permalink

    Returns the appropriate instance for the given key constructed from the passed type T and given java.lang.annotation.Annotation class.

    Returns the appropriate instance for the given key constructed from the passed type T and given java.lang.annotation.Annotation class.

    When feasible, avoid using this method in favor of having the Injector inject your dependencies ahead of time via annotating your constructor with @Inject.

    T

    type of the bound instance to return from the object graph.

    annotationClazz

    class of java.lang.annotation.Annotation used to disambiguate the bound type T.

    returns

    bound instance of type T annotated with annotation class.

  6. abstract def instance[T](annotation: Annotation)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T

    Permalink

    Returns the appropriate instance for the given key constructed from the passed type T and given java.lang.annotation.Annotation annotation.

    Returns the appropriate instance for the given key constructed from the passed type T and given java.lang.annotation.Annotation annotation.

    When feasible, avoid using this method in favor of having the Injector inject your dependencies ahead of time via annotating your constructor with @Inject.

    T

    type of the bound instance to return from the object graph.

    annotation

    java.lang.annotation.Annotation instance used to disambiguate the bound type T.

    returns

    bound instance of type T annotated with annotation.

  7. abstract def instance[T, Ann <: Annotation](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], arg1: ClassTag[Ann]): T

    Permalink

    Returns the appropriate instance for the given key constructed from the passed type T and given java.lang.annotation.Annotation type Ann.

    Returns the appropriate instance for the given key constructed from the passed type T and given java.lang.annotation.Annotation type Ann.

    When feasible, avoid using this method in favor of having the Injector inject your dependencies ahead of time via annotating your constructor with @Inject.

    T

    type of the bound instance to return from the object graph.

    Ann

    type of the annotation used to disambiguate the bound type T.

    returns

    bound instance of type T annotated with annotation type Ann.

  8. abstract def instance[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T

    Permalink

    Returns the appropriate instance for the given key constructed from the passed type T.

    Returns the appropriate instance for the given key constructed from the passed type T.

    When feasible, avoid using this method in favor of having the Injector inject your dependencies ahead of time via annotating your constructor with @Inject.

    T

    type of the bound instance to return from the object graph.

    returns

    bound instance of type T.

  9. abstract def underlying: google.inject.Injector

    Permalink

    Returns the underlying Guice injector.

  10. abstract def instance[T](name: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T

    Permalink

    Returns the appropriate instance for the given key constructed from the passed type T and given String name which is interpreted to be the value of a @Named annotation.

    Returns the appropriate instance for the given key constructed from the passed type T and given String name which is interpreted to be the value of a @Named annotation.

    When feasible, avoid using this method in favor of having the Injector inject your dependencies ahead of time via annotating your constructor with @Inject.

    T

    type of the bound instance to return from the object graph.

    name

    String value of @Named annotation.

    returns

    bound instance of type T annotated with @Named(name).

    Annotations
    @deprecated
    Deprecated

    (Since version 2017-09-25) Users should prefer injector.instance[T](java.lang.annotation.Annotation

    See also

    com.google.inject.name.Named

Concrete Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

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

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

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

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

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

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

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped