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.
- Alphabetic
- By Inheritance
- Injector
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def instance[T](key: Key[T]): T
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
- abstract def instance[T, Ann <: Annotation](clazz: Class[T], annotationClazz: Class[Ann]): T
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.
- abstract def instance[T](clazz: Class[T], annotation: Annotation): T
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.
- abstract def instance[T](clazz: Class[T]): T
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.
- abstract def instance[T](annotationClazz: Class[_ <: Annotation])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T
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.
- abstract def instance[T](annotation: Annotation)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T
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.
- abstract def instance[T, Ann <: Annotation](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], arg1: ClassTag[Ann]): T
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.
- abstract def instance[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T
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.
- abstract def underlying: google.inject.Injector
Returns the underlying Guice injector.
- abstract def instance[T](name: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T
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
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()