Package

scaldi

Permalink

package scaldi

Scaldi - is Scala dependency injection library. Basically Scala already have everything you need for dependency injection. But still some things can be made easier. Goal of the project is to provide more standard and easy way to make dependency injection in Scala projects consuming power of the Scala language. With Scaldi you can define your application modules in pure Scala without any annotations or XML.

For more information see: http://scaldi.org

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

Type Members

  1. case class AndCondition(conditions: List[Condition]) extends Condition with Product with Serializable

    Permalink
  2. class BindHelper[R] extends CanBeIdentified[BindHelper[R]] with CanBeConditional[BindHelper[R]]

    Permalink
  3. trait Binding extends Identifiable

    Permalink

    Binding is defined in a Module as Type -> instance relationship (sometimes with additional identifiers).

    Binding is defined in a Module as Type -> instance relationship (sometimes with additional identifiers). I can be injected in classes where implicit Injector is available. Binding can be defined (containing a value) or undefined.

  4. class BindingException extends RuntimeException

    Permalink
  5. case class BindingLifecycle[-T](initialize: Option[(T) ⇒ Unit] = None, destroy: Option[(T) ⇒ Unit] = None) extends Product with Serializable

    Permalink
  6. trait BindingWithLifecycle extends Identifiable

    Permalink

    Bindings with lifecycle may have initialization and destruction handlers

  7. class BoundHelper[D] extends CanBeIdentified[BoundHelper[D]] with CanBeConditional[BoundHelper[D]] with CanHaveLifecycle[BoundHelper[D], D]

    Permalink
  8. class ByWord extends AnyRef

    Permalink

    Helper class to make injection with default value more readable.

  9. trait CanBeConditional[R] extends AnyRef

    Permalink
  10. trait CanBeIdentified[R] extends AnyRef

    Permalink
  11. trait CanBeIdentifier[T] extends AnyRef

    Permalink

    Implementation to implicitly transform T class to an Identifier

    Implementation to implicitly transform T class to an Identifier

    T

    type that should be transformed to an Identifier

    Annotations
    @implicitNotFound( ... )
  12. trait CanCompose[-A, -B, +R] extends AnyRef

    Permalink

    Typeclass that will handle the composition of different injectors

    Typeclass that will handle the composition of different injectors

    A

    type of the first injector in the composition

    B

    type of the second injector in the composition

    R

    type of the resulting injector in the composition

    Annotations
    @implicitNotFound( ... )
  13. trait CanHaveLifecycle[H, D] extends AnyRef

    Permalink
  14. trait Condition extends AnyRef

    Permalink
  15. class DynamicModule extends WordBinder with InjectorWithLifecycle[DynamicModule] with OpenInjectable with MutableInjectorUser with ShutdownHookLifecycleManager

    Permalink

    Same as module, but with accessible Injectable's methods.

  16. trait Freezable extends AnyRef

    Permalink

    Trait for injectors that are freezable i.e.

    Trait for injectors that are freezable i.e. may no longer be modified from e certain point

  17. trait Identifiable extends AnyRef

    Permalink

    Entities that extend Identifiable can be identified using Scaldi identifiers.

    Entities that extend Identifiable can be identified using Scaldi identifiers. They can also contain conditions.

  18. class IdentifiedWord[+T] extends AnyRef

    Permalink

    Helper class to make injection by identifier more readable.

    Helper class to make injection by identifier more readable.

    T

    type of the dependency being injected

  19. trait Identifier extends AnyRef

    Permalink

    Used to identify a binding.

    Used to identify a binding. If you have two bindings of the same type (like String bindings), the identifiers may be used to identify and to inject the right one

  20. trait ImmutableInjector extends Injector

    Permalink

    Immutable injectors that don't have any lifecycle associated with it.

  21. class ImmutableInjectorAggregation extends Injector

    Permalink

    The result of the composition of two or more of the immutable injectors

  22. class ImmutableWrapper extends Injector with ImmutableInjector

    Permalink

    A very simple implementation of an injector that just delegates the binding lookup to some other injector.

    A very simple implementation of an injector that just delegates the binding lookup to some other injector. This will protect the lifecycle of the delegated injector from any changes. It is useful in a case of a scoped binding: if you want to use the injector in a composition, but don't want the composition's lifecycle to influence it. In that case, before creating the composition wrap the injector into the ImmutableWrapper.

  23. trait Initializeable[I] extends Freezable

    Permalink

    Trait for injectors that are initializeable i.e.

    Trait for injectors that are initializeable i.e. have initialization phase

    I

    type for initializeable injector

  24. case class InjectConstraints[+T](default: Option[() ⇒ T] = None, initialIdentifiers: List[Identifier] = Nil) extends Product with Serializable

    Permalink

    A wrapper for a default value for the injection and for its identifiers.

    A wrapper for a default value for the injection and for its identifiers.

    It is here to make injection constraints look like natural language.

    T

    type of the dependency being injected

    default

    default value for injected instance. It would be used if biding is not found in the Injector.

    initialIdentifiers

    identifiers

  25. class InjectException extends RuntimeException

    Permalink

    Custom exception for injectors

  26. trait Injectable extends Wire

    Permalink

    Provides injection DSL.

    Provides injection DSL. You can extend it in your classes in order to use inject methods.

    The only responsibility of this trait is to provide you with inject function (so it just provides nice syntax for injecting dependencies).

    In order to actually find and inject dependencies, inject method always takes an implicit parameter of type Injector.

    Example:

    Application (implicit inj: Injector) extends Injectable {
       protected val db = inject [Database] // database can now be used as an instance of Database class`
    }
  27. trait Injector extends AnyRef

    Permalink

    A base entity that encapsulates the binding lookup mechanism

  28. trait InjectorWithLifecycle[I <: InjectorWithLifecycle[I]] extends Injector with Initializeable[I] with MutableInjector

    Permalink

    Trait for injectors that have lifecycle

    Trait for injectors that have lifecycle

    I

    type for initializeable injector

  29. case class LazyBinding(createFn: Option[() ⇒ Any], identifiers: List[Identifier] = Nil, condition: Option[() ⇒ Condition] = None, lifecycle: BindingLifecycle[Any] = BindingLifecycle.empty) extends BindingWithLifecycle with Product with Serializable

    Permalink

    Binding that is initialized on on first use and never changes afterwards.

    Binding that is initialized on on first use and never changes afterwards.

    createFn

    function that creates and returns value that will be associated with binding

    identifiers

    binding's identifiers (empty by default)

    condition

    binding's conditions (empty by default)

    lifecycle

    binding's lifecycle (empty by default)

  30. trait LifecycleManager extends AnyRef

    Permalink
  31. trait LowPriorityImmutableInjectorComposition extends LowPriorityMutableInjectorComposition

    Permalink
  32. trait LowPriorityMutableInjectorComposition extends AnyRef

    Permalink
  33. trait Module extends WordBinder with InjectorWithLifecycle[Module] with Injectable with MutableInjectorUser with ShutdownHookLifecycleManager

    Permalink

    Module is a place where you declare your bindings.

    Module is a place where you declare your bindings. It's also the most common injector that you can use in most cases. It's a mutable injector so it can have a lifecycle and it also provides nice DSL for the bindings.

    Module is an Injectable instance thanks to that you can inject other dependencies in module's bindings.

  34. trait MutableInjector extends Injector

    Permalink

    Mutable injectors that have a lifecycle associated with them.

  35. class MutableInjectorAggregation extends InjectorWithLifecycle[MutableInjectorAggregation] with MutableInjectorUser with ShutdownHookLifecycleManager

    Permalink

    The result of the composition of two or more of the mutable injectors

  36. trait MutableInjectorUser extends MutableInjector

    Permalink

    Contains implicit reference to injector: the final injector composition which is used by inject.

    Contains implicit reference to injector: the final injector composition which is used by inject. Injector aggregation will set it during the initialization phase

  37. case class NonLazyBinding(createFn: Option[() ⇒ Any], identifiers: List[Identifier] = Nil, condition: Option[() ⇒ Condition] = None, lifecycle: BindingLifecycle[Any] = BindingLifecycle.empty) extends BindingWithLifecycle with Product with Serializable

    Permalink

    Binding that is initialized at the Injector initialization phase (normally during an application startup) and never changes afterwards.

    Binding that is initialized at the Injector initialization phase (normally during an application startup) and never changes afterwards.

    createFn

    function that creates and returns value that will be associated with binding

    identifiers

    binding's identifiers (empty by default)

    condition

    binding's conditions (empty by default)

    lifecycle

    binding's lifecycle (empty by default)

  38. case class NotCondition(condition: Condition) extends Condition with Product with Serializable

    Permalink
  39. trait OpenInjectable extends Injectable

    Permalink

    Exactly the same as Injectable trait, but with all methods made public

  40. case class OrCondition(conditions: List[Condition]) extends Condition with Product with Serializable

    Permalink
  41. class PropertiesInjector extends RawInjector

    Permalink

    Used to look for simple bindings in supplied properties (hash table)

  42. case class ProviderBinding(createFn: () ⇒ Any, identifiers: List[Identifier] = Nil, condition: Option[() ⇒ Condition] = None, lifecycle: BindingLifecycle[Any] = BindingLifecycle.empty) extends BindingWithLifecycle with Product with Serializable

    Permalink

    Binding that is initialized on every injection with createFn function.

    Binding that is initialized on every injection with createFn function.

    createFn

    function that creates and returns value that will be associated with binding

    identifiers

    binding's identifiers (empty by default)

    condition

    binding's conditions (empty by default)

    lifecycle

    binding's lifecycle (empty by default)

  43. case class RawBinding(value: Any, identifiers: List[Identifier]) extends Binding with Product with Serializable

    Permalink

    Binding with a raw value, not converted to any specific type (value from system properties, configuration, etc.).

    Binding with a raw value, not converted to any specific type (value from system properties, configuration, etc.).

    value

    value of the binding

    identifiers

    identifiers defining the binding

  44. trait RawInjector extends Injector

    Permalink

    Abstract Injector implementation that may be extended by other injectors that get values from specific source (command line, typesafe config, properties, etc.)

  45. case class RequiredIdentifier(delegate: Identifier, isRequired: Boolean) extends Identifier with Product with Serializable

    Permalink

    Wraps a delegated Identifier as a required or not required

    Wraps a delegated Identifier as a required or not required

    delegate

    delegated Identifier

    isRequired

    true if the wrapped identifier should be required

  46. trait ShutdownHookLifecycleManager extends LifecycleManager

    Permalink
  47. case class SimpleBinding[T](boundValue: Option[() ⇒ T], identifiers: List[Identifier] = Nil, condition: Option[() ⇒ Condition] = None, cacheable: Boolean = false, eager: Boolean = false) extends Binding with Product with Serializable

    Permalink

    Binding that only contains a value.

    Binding that only contains a value. As it is just a fixed value, no lifecycle is needed

    T

    binding's type

    boundValue

    binding's value

    identifiers

    binding's identifiers (empty by default)

    condition

    binding's conditions (empty by default)

    cacheable

    if binding should be cacheable (false by default)

    eager

    if binding is eager (non lazy) (false by default)

  48. class SimpleContainerInjector extends MutableInjectorUser with InjectorWithLifecycle[SimpleContainerInjector] with ShutdownHookLifecycleManager

    Permalink

    Container that transforms a list of bindings into a valid Injector

  49. case class StringIdentifier(str: String) extends Identifier with Product with Serializable

    Permalink

    Defines an identifier from a String

    Defines an identifier from a String

    str

    String that will be the identifier

  50. case class SysPropCondition(name: String, value: Option[String] = None, dynamic: Boolean = false) extends Condition with Product with Serializable

    Permalink
  51. case class TypeTagIdentifier(tpe: scala.reflect.api.JavaUniverse.Type) extends Identifier with Product with Serializable

    Permalink

    Identifier created from any Scala type

    Identifier created from any Scala type

    tpe

    instance that will be defined as in Identifier

  52. class TypesafeConfigInjector extends RawInjector

    Permalink

    Injector with bindings found in supplied typesafe configuration

  53. trait Wire extends AnyRef

    Permalink
  54. class WireBuilder extends AnyRef

    Permalink
  55. trait WordBinder extends AnyRef

    Permalink
  56. case class WordBindingProvider[T](bindingFn: (List[Identifier], Option[() ⇒ Condition], BindingLifecycle[Any]) ⇒ BindingWithLifecycle) extends Product with Serializable

    Permalink
  57. trait BindingProvider extends AnyRef

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.5) BindingProvider is deprecated and will be removed soon. As an alternative you can use ImmutableWrapper injector to define an immutability boundary in composition or create your own injector that is marked as ImmutableInjector.

  58. trait ReflectionBinder extends AnyRef

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.5) ReflectionBinder is deprecated and will be removed soon. As an alternative you can use WordBinder or create your own injector that is marked as ImmutableInjector.

  59. trait StaticModule extends ReflectionBinder with ImmutableInjector with Injectable

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.5)

Value Members

  1. object Args

    Permalink

    Factory for creating injector from command line arguments

  2. object Binding

    Permalink
  3. object BindingLifecycle extends Serializable

    Permalink
  4. object BindingWithLifecycle

    Permalink
  5. object CanBeIdentifier

    Permalink
  6. object Condition

    Permalink
  7. object DynamicModule

    Permalink
  8. object Identifier

    Permalink
  9. object ImmutableWrapper

    Permalink
  10. object Injectable extends OpenInjectable

    Permalink

    Companion object of Injectable which can be just imported in contrast to Injectable trait which always need to be extended.

    Companion object of Injectable which can be just imported in contrast to Injectable trait which always need to be extended. After importing it, you can use an injection DSL without extending the trait.

    Example:

    import scaldi.Injectable._
    
    val database = inject [Database]
  11. object Injector extends LowPriorityImmutableInjectorComposition

    Permalink
  12. object NilInjector extends ImmutableInjector

    Permalink

    Empty injector, used for injector combination or as a filler where injector is required, but there are no bindings.

  13. object PropertiesInjector

    Permalink

    Factories to handle different type of properties' source.

  14. object SystemPropertiesInjector extends RawInjector

    Permalink

    Used to look up for simple bindings in system properties.

  15. object TypeTagIdentifier extends Serializable

    Permalink
  16. object TypesafeConfigInjector

    Permalink

    Factories to handle different type of Typesafe config's source.

  17. object WireBuilder

    Permalink
  18. package util

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped