Trait

scaldi

StaticModule

Related Doc: package scaldi

Permalink

trait StaticModule extends ReflectionBinder with ImmutableInjector with Injectable

Annotations
@deprecated
Deprecated

(Since version 0.5)

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StaticModule
  2. Injectable
  3. Wire
  4. ImmutableInjector
  5. Injector
  6. ReflectionBinder
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. case class ReflectiveBinding(fn: () ⇒ Option[Any], identifiers: List[Identifier]) extends Binding with Product with Serializable

    Permalink
    Definition Classes
    ReflectionBinder

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ++[I <: Injector, R <: Injector](other: I)(implicit comp: CanCompose[StaticModule.this.type, I, R]): R

    Permalink
    Definition Classes
    Injector
  4. def ::[I <: Injector, R <: Injector](other: I)(implicit comp: CanCompose[I, StaticModule.this.type, R]): R

    Permalink
    Definition Classes
    Injector
  5. final def ==(arg0: Any): Boolean

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

    Permalink
    Definition Classes
    Any
  7. val by: ByWord

    Permalink

    Convenience field to make the injection look more readable when used with default values for the injection.

    Convenience field to make the injection look more readable when used with default values for the injection.

    Example: inject [Database] (by default defaultDb)

    Attributes
    protected
    Definition Classes
    Injectable
  8. implicit def canBeIdentifiedToConstraints[T](target: T)(implicit arg0: CanBeIdentifier[T]): InjectConstraints[Nothing]

    Permalink

    Implicit cast of classes that can be identifiers to an InjectConstraints with the identified as a first element.

    Implicit cast of classes that can be identifiers to an InjectConstraints with the identified as a first element.

    Often used when a list of identifiers should be passed (for example for inject(constraint) method).

    This lets us to put the identifier in a first place to make the parameters look readable.

    T

    type that qualifies as an identifier

    target

    Instance of a class that qualifies as an identifier

    returns

    InjectConstraints

    Attributes
    protected
    Definition Classes
    Injectable
  9. def clone(): AnyRef

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def getBinding(identifiers: List[Identifier]): Option[Binding]

    Permalink

    Single binding lookup

    Single binding lookup

    identifiers

    binding's identifiers

    returns

    option with binding (None if not found)

    Definition Classes
    StaticModuleInjector
  14. def getBindings(identifiers: List[Identifier]): List[Binding]

    Permalink

    List of bindings lookup

    List of bindings lookup

    identifiers

    bindings identifiers

    returns

    list of found bindings

    Definition Classes
    StaticModuleInjector
  15. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  17. val identified: IdentifiedWord[Nothing]

    Permalink

    Convenience field to make the injection look more readable when used with identifiers.

    Convenience field to make the injection look more readable when used with identifiers.

    Example: inject [Database] (identified by 'local)

    Attributes
    protected
    Definition Classes
    Injectable
  18. def inject[T](constraints: ⇒ InjectConstraints[T])(implicit injector: Injector, tt: scala.reflect.api.JavaUniverse.TypeTag[T], nn: NotNothing[T]): T

    Permalink

    Injects a dependency defined by a constraint.

    Injects a dependency defined by a constraint.

    Usually used when there are more than one injections for a defined type T

    Example:

    binding identifiedBy 'host to "hostName"
    val host = inject[String]('host)  // equals to "hostName"
    val db = inject (by default defaultDb) // notice that type `T` is optional in inferred in this case
    T

    type of the injected dependency

    constraints

    constraints helping to define what dependency of the type T to inject (typically an identifier, string or a default value)

    injector

    implicit Injector, should be defined in the scope. It's used to lookup bindings

    tt

    ensures that meta-information if type T is available at the runtime

    nn

    ensures, that type T is not inferred as Nothing by scala compiler, since inject needs to know the actual type at the runtime

    returns

    instance of injected dependency

    Attributes
    protected
    Definition Classes
    Injectable
  19. def inject[T](implicit injector: Injector, tt: scala.reflect.api.JavaUniverse.TypeTag[T], nn: NotNothing[T]): T

    Permalink

    Injects a dependency that was previously defined in a module

    Injects a dependency that was previously defined in a module

    Example: val database = inject [Database] // database can now be used as an instance of Database class

    T

    type of the injected dependency

    injector

    implicit Injector, should be defined in the scope. It's used to lookup bindings

    tt

    ensures that meta-information if type T is available at the runtime

    nn

    ensures, that type T is not inferred as Nothing by scala compiler, since inject needs to know the actual type at the runtime

    returns

    instance of injected dependency

    Attributes
    protected
    Definition Classes
    Injectable
  20. def injectAll(identifiers: Identifier*)(implicit injector: Injector): List[Any]

    Permalink

    Injects all dependencies that are defined by identifiers.

    Injects all dependencies that are defined by identifiers.

    identifiers

    identifiers that were defined in module for requested injections

    injector

    implicit Injector, should be defined in the scope. It's used to lookup bindings

    returns

    a list of injected instances defined by identifiers

    Attributes
    protected
    Definition Classes
    Injectable
  21. def injectAllOfType[T](identifiers: Identifier*)(implicit injector: Injector, tt: scala.reflect.api.JavaUniverse.TypeTag[T], nn: NotNothing[T]): List[T]

    Permalink

    Inject all dependencies of type T that were defined in a module and that are defined by supplied identifiers.

    Inject all dependencies of type T that were defined in a module and that are defined by supplied identifiers.

    T

    type of the injected dependency

    identifiers

    identifiers that were defined in module for requested injections

    injector

    implicit Injector, should be defined in the scope. It's used to lookup bindings

    tt

    ensures that meta-information if type T is available at the runtime

    nn

    ensures, that type T is not inferred as Nothing by scala compiler, since inject needs to know the actual type at the runtime

    returns

    a list of injected instances satisfying the type T constraint and identifiers

    Attributes
    protected
    Definition Classes
    Injectable
  22. def injectAllOfType[T](implicit injector: Injector, tt: scala.reflect.api.JavaUniverse.TypeTag[T], nn: NotNothing[T]): List[T]

    Permalink

    Inject all dependencies of type T that were defined in a module.

    Inject all dependencies of type T that were defined in a module.

    T

    type of the injected dependency

    injector

    implicit Injector, should be defined in the scope. It's used to lookup bindings

    tt

    ensures that meta-information if type T is available at the runtime

    nn

    ensures, that type T is not inferred as Nothing by scala compiler, since inject needs to know the actual type at the runtime

    returns

    a list of injected instances satisfying the type T constraint

    Attributes
    protected
    Definition Classes
    Injectable
  23. def injectProvider[T](constraints: ⇒ InjectConstraints[T])(implicit injector: Injector, tt: scala.reflect.api.JavaUniverse.TypeTag[T], nn: NotNothing[T]): () ⇒ T

    Permalink

    Injects a dependency (defined by a constraint) that was previously defined as a provider in a module.

    Injects a dependency (defined by a constraint) that was previously defined as a provider in a module.

    Usually used when there are more than one provider for a defined type T.

    T

    type of the injected dependency

    constraints

    constraints helping to define what dependency of type T to inject (typically an identifier, string or a default value)

    injector

    implicit Injector, should be defined in the scope. It's used to lookup bindings

    tt

    ensures that meta-information if type T is available at the runtime

    nn

    ensures, that type T is not inferred as Nothing by scala compiler, since inject needs to know the actual type at the runtime

    returns

    a new instance of injected dependency

    Attributes
    protected
    Definition Classes
    Injectable
  24. def injectProvider[T](implicit injector: Injector, tt: scala.reflect.api.JavaUniverse.TypeTag[T], nn: NotNothing[T]): () ⇒ T

    Permalink

    Injects a dependency that was previously defined as a provider in a module

    Injects a dependency that was previously defined as a provider in a module

    T

    type of the injected dependency

    injector

    implicit Injector, should be defined in the scope. It's used to lookup bindings

    tt

    ensures that meta-information if type T is available at the runtime

    nn

    ensures, that type T is not inferred as Nothing by scala compiler, since inject needs to know the actual type at the runtime

    returns

    a new instance of injected dependency

    Attributes
    protected
    Definition Classes
    Injectable
  25. def injectWithConstructorDefault[T, C](paramName: String)(implicit injector: Injector, tt: scala.reflect.api.JavaUniverse.TypeTag[T], ct: scala.reflect.api.JavaUniverse.TypeTag[C]): T

    Permalink

    Injects a dependency defined by type T.

    Injects a dependency defined by type T. If dependency is not found, initializes it with the default value from the constructor of type T.

    This implies, that constructor must have one constructor with parameter paramName which has a default value. Method is part of injected macro implementation and not intended to be used outside of it.

    Uses reflection.

    T

    type of the injected dependency

    C

    class of constructor in case dependency cannot be found by T identifier

    paramName

    name of the constructor argument with a default value

    injector

    implicit Injector, should be defined in the scope. It's used to lookup bindings

    tt

    ensures that meta-information if type T is available at the runtime

    ct

    ensures that meta-information if type C is available at the runtime

    returns

    instance of injected dependency. If not found by, initializes one using constructor C

    Attributes
    protected
    Definition Classes
    Injectable
  26. def injectWithDefault[T](injector: Injector, default: ⇒ T)(identifiers: List[Identifier]): T

    Permalink

    Setup an injection that returns default value if an injection with supplied identifiers is not found.

    Setup an injection that returns default value if an injection with supplied identifiers is not found.

    T

    type of the injected dependency

    injector

    current Injector, used to lookup bindings

    default

    default value to return in case injection is not found

    identifiers

    identifiers that define requested injection

    returns

    injection defined by identifiers or default value if injection is not found

    Attributes
    protected
    Definition Classes
    Injectable
  27. macro def injected[T](overrides: Tuple2[String, _]*): T

    Permalink
    Definition Classes
    Wire
  28. macro def injected[T](overrides: Tuple2[Symbol, _]*): T

    Permalink
    Definition Classes
    Wire
  29. macro def injected[T]: T

    Permalink
    Definition Classes
    Wire
  30. implicit val injector: Injector

    Permalink
  31. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    AnyRef
  33. def noBindingFound(identifiers: List[Identifier]): Nothing

    Permalink

    Helper method for throwing a readable exception when a binding could not be found.

    Helper method for throwing a readable exception when a binding could not be found.

    identifiers

    a list of identifiers

    Attributes
    protected
    Definition Classes
    Injectable
  34. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  36. lazy val reflectiveBindings: List[Binding]

    Permalink
    Definition Classes
    ReflectionBinder
  37. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from Injectable

Inherited from Wire

Inherited from ImmutableInjector

Inherited from Injector

Inherited from ReflectionBinder

Inherited from AnyRef

Inherited from Any

Ungrouped