Builder
Allows for the DSL inside the block argument of the constructor of DI and DI.Module.
Methods of this classes are really just proxies to the DIContainer.Builder methods.
Inheritors
Types
Left part of the constant-binding syntax (constant(tag)).
Left part of the delegate-binding syntax (delegate(tag)).
Left part of the direct-binding syntax (bind(tag)).
Left part of the type-binding syntax (bind(type, tag)).
Properties
Functions
Defines that the binding will be saved in a set binding.
Starts a direct binding with a given tag. A direct bind does not define the type to be bound, the type will be defined according to the bound factory.
Attaches the binding of a given type with a given tag.
Starts the binding of a given type with a given tag.
Starts the binding of a given type with a given tag.
Attaches a binding to the DI container
Binds a class type to a dependency injection (DI) builder.
Creates a set: multiple bindings can be added in this set.
Creates a set and add multiple bindings to it.
Binds a constant provider: will always return the given instance.
Binds an eager singleton: will create an instance as soon as kodein is ready (all bindings are set) and will always return this instance.
Binds an instance provider: will always return the given instance.
Creates a factory: each time an instance is needed, the function creator function will be called.
Creates a factory: each time an instance is needed, the function constructor function will be called.
Creates a set: multiple bindings can be added in this set.
Creates a set and add multiple bindings to it.
Binds a singleton: will create an instance on first request and will subsequently always return the same instance.
Binds a singleton: will create an instance on first request and will subsequently always return the same instance.
Starts a constant binding.
Used to define bindings with a context: bind<MyType>() with contexted<MyContext>().provider { /*...*/ }
Delegate the targeted type to a new binding type
Creates an eager singleton: will create an instance as soon as kodein is ready (all bindings are set) and will always return this instance.
Like import but checks that will only import each module once.
Add multiple bindings in an existing set
Creates an instance provider: will always return the given instance.
Creates a multiton: will create an instance on first request for each different argument and will subsequently always return the same instance for the same argument.
Used to define bindings with a scope: bind<MyType>() with scoped(myScope).singleton { /*...*/ }