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.
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)).
Functions
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.
Creates a Set binding of a given type with a given tag and attaches multiple bindings to it.
Starts a constant binding.
Imports all bindings defined in the given DI.Modules into this builder's definition.
Like import but checks that will only import each module once.
Properties
Inheritors
Extensions
Defines that the binding will be saved in a set binding.
Attaches a binding to the DI container
Starts the binding of a given type with a given tag.
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 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.
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.
Add multiple bindings in an existing set
Creates an instance provider: will always return the given instance.
Used to define bindings with a scope: bind<MyType>() with scoped(myScope).singleton { /*...*/ }