Trait

com.escalatesoft.subcut.inject

BindingModule

Related Doc: package inject

Permalink

trait BindingModule extends AnyRef

The main BindingModule trait. Not intended to be used directly, instead extend NewBindingModule with a function to create the bindings (recommended - the result will be immutable) or a MutableBindingModule (not recommended unless you know what you are doing and take on the thread safety responsibility yourself).

Self Type
BindingModule
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BindingModule
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def bindings: Map[BindingKey[_], Any]

    Permalink

    Abstract binding map definition

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. def andThen(other: BindingModule): BindingModule

    Permalink

    Merge this module with another.

    Merge this module with another. The resulting module will include all bindings from both modules, with this module winning if there are common bindings (binding override). If you prefer symbolic operators, ~ is an alias for this.

    other

    another BindingModule to cons with this one. Any duplicates will favor the bindings from this rather than other.

  5. final def asInstanceOf[T0]: T0

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def inject[T](name: Option[String])(implicit arg0: Manifest[T]): T

    Permalink

    Inject for a given class with optional name.

    Inject for a given class with optional name. Whatever is bound to the class will be provided. If the name is given, only a matching class/name pair will be used, and it will not fall back to just providing an implementation based only on the class.

    name

    an optional name to use for the binding match

    returns

    the instance the binding was configured to return

  13. def injectOptional[T](key: BindingKey[T]): Option[T]

    Permalink

    Retrieve an optional binding for class T with the given BindingKey, if no binding is available for the binding key, a None will be returned, otherwise the binding will be evaluated and an instance of a subclass of T will be returned.

    Retrieve an optional binding for class T with the given BindingKey, if no binding is available for the binding key, a None will be returned, otherwise the binding will be evaluated and an instance of a subclass of T will be returned.

    key

    a BindingKey to use for the lookup

    returns

    Option[T] containing either an instance subtype of T, or None if no matching binding is found.

  14. def injectOptional[T](name: Option[String])(implicit arg0: Manifest[T]): Option[T]

    Permalink

    Retrieve an optional binding for class T with the optional name provided.

    Retrieve an optional binding for class T with the optional name provided. If no binding is available with the given class and optional name, a None will be returned, otherwise the binding will be evaluated and an instance of a subclass of T will be returned.

    name

    Option[String] name, if present will be matched, if None only class will be used for lookup (note, this also means any named bindings of the same type will not be matched)

    returns

    Option[T] containing either an instance subtype of T, or None if no matching binding is found.

  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def listBindings: Iterable[String]

    Permalink

    A convenient way to obtain a string representation of the current bindings in this module.

    A convenient way to obtain a string representation of the current bindings in this module. Useful for debugging.

  17. def modifyBindings[A](fn: (MutableBindingModule) ⇒ A): A

    Permalink

    Provide a mutable copy of these bindings to a passed in function so that it can override the bindings for just the scope of that function.

    Provide a mutable copy of these bindings to a passed in function so that it can override the bindings for just the scope of that function. Useful for testing.

    fn

    a function that takes the new mutable binding copy and may use it within scope. Can return any type, and the any return from the function will be returned from this function.

    returns

    the value returned from the provided function.

  18. final def ne(arg0: AnyRef): Boolean

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def ~(other: BindingModule): BindingModule

    Permalink

    Merge this module with another.

    Merge this module with another. The resulting module will include all bindings from both modules, with this module winning if there are common bindings (binding override). If you prefer non-symbolic methods, "andThen" is an alias for this.

    other

    another BindingModule to cons with this one. Any duplicates will favor the bindings from this rather than other.

    Annotations
    @inline()

Inherited from AnyRef

Inherited from Any

Ungrouped