extend

abstract fun extend(    di: DI,     allowOverride: Boolean = false,     copy: Copy = Copy.NonCached)

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

Note that this preserves scopes, meaning that a singleton-bound in the di argument will continue to exist only once. Both di objects will share the same instance.

Note that externalSource will be overeridden if defined in the extended DI.

Parameters

di

The di object to import.

allowOverride

Whether this module is allowed to override existing bindings. If it is not, overrides (even explicit) will throw an OverridingException.

copy

The copy specifications, that defines which bindings will be copied to the new container. All bindings from the extended container will be accessible in the new container, but only the copied bindings are able to access overridden bindings in this new container. By default, all bindings that do not hold references (e.g. not singleton or multiton) are copied.

Throws

If this di overrides an existing binding and is not allowed to OR allowOverride is true while YOU don't have the permission to override.


abstract fun extend(    directDI: DirectDI,     allowOverride: Boolean = false,     copy: Copy = Copy.NonCached)

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

Note that this preserves scopes, meaning that a singleton-bound in the di argument will continue to exist only once. Both di objects will share the same instance.

Note that externalSource will be overeridden if defined in the extended DI.

Parameters

directDI

The direct di object to import.

allowOverride

Whether this module is allowed to override existing bindings. If it is not, overrides (even explicit) will throw an OverridingException.

copy

The copy specifications, that defines which bindings will be copied to the new container. All bindings from the extended container will be accessible in the new container, but only the copied bindings are able to access overridden bindings in this new container. By default, all bindings that do not hold references (e.g. not singleton or multiton) are copied.

Throws

If this di overrides an existing binding and is not allowed to OR allowOverride is true while YOU don't have the permission to override.