Trait

com.escalatesoft.subcut.inject

AutoInjectable

Related Doc: package inject

Permalink

trait AutoInjectable extends Injectable

AutoInjectable is identical to Injectable except that if you are using the compiler plugin, the implicit bindingModule parameter will be automatically filled in for you. It is provided as a convenient boilerplate buster but is distinct from Injectable because sometimes you want to mark something as Injectable but keep the injection abstract until later.

Linear Supertypes
Injectable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AutoInjectable
  2. Injectable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. implicit abstract def bindingModule: BindingModule

    Permalink
    Definition Classes
    Injectable

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. def inject[T](name: String)(implicit m: Manifest[T]): T

    Permalink

    Inject an instance for the given trait based on the class type required and an ID string.

    Inject an instance for the given trait based on the class type required and an ID string. If there is no matching binding, this method will throw a BindingException. The string ID is interchangeable with the symbol version of the same ID, in other words 'maxPoolSize and "maxPoolSize" are considered equivalent by the lookup mechanism.

    name

    the identifying name to look up for the binding, e.g. "maxPoolSize"

    returns

    an instance configured by the binding module to use for the given trait and ID

    Definition Classes
    Injectable
  12. def inject[T](symbol: Symbol)(implicit m: Manifest[T]): T

    Permalink

    Inject an instance for the given trait based on the class type required and an ID symbol.

    Inject an instance for the given trait based on the class type required and an ID symbol. If there is no matching binding, this method will throw a BindingException. The Symbol provided will be converted to a string prior to the lookup, so the symbol is interchangeable with the string version of the same ID, in other words 'maxPoolSize and "maxPoolSize" are considered equivalent by the lookup mechanism.

    symbol

    the identifying name to look up for the binding, e.g. 'maxPoolSize

    returns

    an instance configured by the binding module to use for the given trait and ID

    Definition Classes
    Injectable
  13. def inject[T](implicit m: Manifest[T]): T

    Permalink

    Inject an instance for the given trait based on the class type required.

    Inject an instance for the given trait based on the class type required. If there is no binding, this method will throw a BindingException. This form is for straight trait injection without an identifying name.

    returns

    an instance configured by the binding module to use for the given trait.

    Definition Classes
    Injectable
  14. def injectIfBound[T](symbol: Symbol)(fn: ⇒ T)(implicit m: Manifest[T]): T

    Permalink

    Inject an instance if a binding for that type is defined.

    Inject an instance if a binding for that type is defined. If it is not defined, the function provided will be used instead to create an instance to be used. This is arguably the most useful and efficient form of injection usage, as the typical configuration can be provided at the call site and developers can easily see what the "usual" instance is. An alternative binding will only be used if it is defined, e.g. for testing. This form of the injector takes a string ID to use in the binding definition lookup, e.g. "maxPoolSize".

    symbol

    ID to be used to identify the matching binding definition.

    fn

    a function to be used to return an instance, if there is no binding defined for the desired trait.

    returns

    an instance that subclasses the trait, either from the binding definitions, or using the provided function if no matching binding is defined.

    Definition Classes
    Injectable
  15. def injectIfBound[T](name: String)(fn: ⇒ T)(implicit m: Manifest[T]): T

    Permalink

    Inject an instance if a binding for that type is defined.

    Inject an instance if a binding for that type is defined. If it is not defined, the function provided will be used instead to create an instance to be used. This is arguably the most useful and efficient form of injection usage, as the typical configuration can be provided at the call site and developers can easily see what the "usual" instance is. An alternative binding will only be used if it is defined, e.g. for testing. This form of the injector takes a symbol ID to use in the binding definition lookup, e.g. 'maxPoolSize.

    name

    symbol ID to be used to identify the matching binding definition.

    fn

    a function to be used to return an instance, if there is no binding defined for the desired trait.

    returns

    an instance that subclasses the trait, either from the binding definitions, or using the provided function if no matching binding is defined.

    Definition Classes
    Injectable
  16. def injectIfBound[T](fn: ⇒ T)(implicit m: Manifest[T]): T

    Permalink

    Inject an instance if a binding for that type is defined.

    Inject an instance if a binding for that type is defined. If it is not defined, the function provided will be used instead to create an instance to be used. This is arguably the most useful and efficient form of injection usage, as the typical configuration can be provided at the call site and developers can easily see what the "usual" instance is. An alternative binding will only be used if it is defined, e.g. for testing. This form of the injector takes only a trait to match and no ID name.

    fn

    a function to be used to return an instance, if there is no binding defined for the desired trait.

    returns

    an instance that subclasses the trait, either from the binding definitions, or using the provided function if no matching binding is defined.

    Definition Classes
    Injectable
  17. def injectIfMissing[T](implToUse: Option[T], symbol: Symbol)(implicit m: Manifest[T]): T

    Permalink

    Inject an instance for the given trait based on the class type only if there is no instance already provided.

    Inject an instance for the given trait based on the class type only if there is no instance already provided. If no instance is provided (i.e. the existing impl passed in is null) and no binding is available to match, a BindingException will be thrown. If an existing impl is provided (not null), then the binding will not be used and does not need to be present. This form of the inject takes a string ID to use to match the binding.

    implToUse

    from the call site. If it is null, the binding provider will fill it in instead

    symbol

    binding ID symbol to use - e.g. 'maxPoolSize

    returns

    an instance configured by the binding module to use for the given trait

    Definition Classes
    Injectable
  18. def injectIfMissing[T](implToUse: Option[T], name: String)(implicit m: Manifest[T]): T

    Permalink

    Inject an instance for the given trait based on the class type only if there is no instance already provided.

    Inject an instance for the given trait based on the class type only if there is no instance already provided. If no instance is provided (i.e. the existing impl passed in is null) and no binding is available to match, a BindingException will be thrown. If an existing impl is provided (not null), then the binding will not be used and does not need to be present. This form of the inject takes a symbol ID to use to match the binding.

    implToUse

    from the call site. If it is null, the binding provider will fill it in instead

    name

    binding ID symbol to use - e.g. 'maxPoolSize

    returns

    an instance configured by the binding module to use for the given trait

    Definition Classes
    Injectable
  19. def injectIfMissing[T](implToUse: Option[T])(implicit m: Manifest[T]): T

    Permalink

    Inject an instance for the given trait based on the class type only if there is no instance already provided.

    Inject an instance for the given trait based on the class type only if there is no instance already provided. If no instance is provided (i.e. the existing impl passed in is null) and no binding is available to match, a BindingException will be thrown. If an existing impl is provided (not null), then the binding will not be used and does not need to be present. This form of the inject does not need a provided ID symbol or string.

    implToUse

    from the call site. If it is null, the binding provider will fill it in instead

    returns

    an instance configured by the binding module to use for the given trait

    Definition Classes
    Injectable
  20. def injectOptional[T](name: String)(implicit m: Manifest[T]): Option[T]

    Permalink

    Inject an optional instance for the given trait based on the class type required and an ID string.

    Inject an optional instance for the given trait based on the class type required and an ID string. If there is no matching binding, this method will return None. The string ID is interchangeable with the symbol version of the same ID, in other words 'maxPoolSize and "maxPoolSize" are considered equivalent by the lookup mechanism.

    name

    the identifying name to look up for the binding, e.g. "maxPoolSize"

    returns

    an optional instance configured by the binding module to use for the given trait and ID

    Definition Classes
    Injectable
  21. def injectOptional[T](symbol: Symbol)(implicit m: Manifest[T]): Option[T]

    Permalink

    Inject an optional instance for the given trait based on the class type required and an ID symbol.

    Inject an optional instance for the given trait based on the class type required and an ID symbol. If there is no matching binding, this method will return None. The Symbol provided will be converted to a string prior to the lookup, so the symbol is interchangeable with the string version of the same ID, in other words 'maxPoolSize and "maxPoolSize" are considered equivalent by the lookup mechanism.

    symbol

    the identifying name to look up for the binding, e.g. 'maxPoolSize

    returns

    an optional instance configured by the binding module to use for the given trait and ID

    Definition Classes
    Injectable
  22. def injectOptional[T](implicit m: Manifest[T]): Option[T]

    Permalink

    Inject an optional instance for the given trait based on the class type required.

    Inject an optional instance for the given trait based on the class type required. If there is no binding, this method will return None. This form is for straight trait injection without an identifying name.

    returns

    an optional instance configured by the binding module to use for the given trait.

    Definition Classes
    Injectable
  23. final def isInstanceOf[T0]: Boolean

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

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

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

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

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

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

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

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

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

Inherited from Injectable

Inherited from AnyRef

Inherited from Any

Ungrouped