winter / io.jentz.winter / WinterInjection / inject

inject

fun inject(instance: Any, injector: Injector): Unit

Get dependency graph for given instance and inject dependencies into injector.

Parameters

instance - The instance to retrieve the dependency graph for.

injector - The injector to inject into.

Exceptions

io.jentz.winter.WinterException - if given instance type is not supported.

fun <T : Any> inject(instance: T, injectSuperClasses: Boolean = false): Unit

Inject into instance by using the dependency graph of the instance. This uses MembersInjector and is useful in conjunction with Winters JSR330 annotation processor.

Parameters

instance - The instance to retrieve the dependency graph for and inject dependencies into.

injectSuperClasses - If true this will look for members injectors for super classes too.

Exceptions

io.jentz.winter.WinterException - If given instance type is not supported.