MainBuilder

interface MainBuilder : DI.Builder

Builder to create a DI object.

Functions

Link copied to clipboard
abstract fun Bind(tag: Any? = null, overrides: Boolean? = null): DI.Builder.DirectBinder

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.

abstract fun <T : Any> Bind(    tag: Any? = null,     overrides: Boolean? = null,     binding: DIBinding<*, *, T>)

Attaches the binding of a given type with a given tag.

abstract fun <T : Any> Bind(    type: TypeToken<out T>,     tag: Any? = null,     overrides: Boolean? = null): DI.Builder.TypeBinder<T>

Starts the binding of a given type with a given tag.

Link copied to clipboard
abstract fun <T : Any> BindSet(    tag: Any? = null,     overrides: Boolean? = null,     binding: DIBinding<*, *, T>)

Attaches the binding of a given type with a given tag.

Link copied to clipboard
abstract fun constant(tag: Any, overrides: Boolean? = null): DI.Builder.ConstantBinder

Starts a constant binding.

Link copied to clipboard
abstract fun <T : Any> Delegate(    type: TypeToken<out T>,     tag: Any? = null,     overrides: Boolean? = null): DI.Builder.DelegateBinder<T>

Create a delegate binding to a given bound type with a given tag.

Link copied to clipboard
abstract fun extend(    di: DI,     allowOverride: Boolean = false,     copy: Copy = Copy.NonCached)
abstract fun extend(    directDI: DirectDI,     allowOverride: Boolean = false,     copy: Copy = Copy.NonCached)

Imports all bindings defined in the given DI into this builder.

Link copied to clipboard
abstract fun import(module: DI.Module, allowOverride: Boolean = false)

Imports all bindings defined in the given DI.Module into this builder's definition.

Link copied to clipboard
abstract fun importAll(vararg modules: DI.Module, allowOverride: Boolean = false)
abstract fun importAll(modules: Iterable<DI.Module>, allowOverride: Boolean = false)

Imports all bindings defined in the given DI.Modules into this builder's definition.

Link copied to clipboard
abstract fun importOnce(module: DI.Module, allowOverride: Boolean = false)

Like import but checks that will only import each module once.

Link copied to clipboard
abstract fun onReady(cb: DirectDI.() -> Unit)

Adds a callback that will be called once the DI object is configured and instantiated.

Link copied to clipboard
abstract fun RegisterContextTranslator(translator: ContextTranslator<*, *>)

Properties

Link copied to clipboard
abstract val containerBuilder: DIContainer.Builder

Every methods eventually ends up to a call to this builder.

Link copied to clipboard
abstract val contextType: TypeToken<Any>

The context type that will be used by all bindings that are defined in this DSL context.

Link copied to clipboard
abstract val explicitContext: Boolean
Link copied to clipboard
abstract val externalSources: MutableList<ExternalSource>

The external source is repsonsible for fetching / creating a value when DI cannot find a matching binding.

Link copied to clipboard
abstract var fullContainerTreeOnError: Boolean

If true, NotFoundException thrown will contain the list of all the bindings available.

Link copied to clipboard
abstract var fullDescriptionOnError: Boolean

If true, exceptions thrown will contain qualified names.

Link copied to clipboard
abstract val scope: Scope<Any>

The scope that will be used by all bindings that are defined in this DSL context.