const mixinafIoc::DependencyProvider
afIoc::DependencyProvider
Implement to provide your own dependency resolution. Extend the capabilities of IoC!
Provide your own dependencies for fields annotated with the @Inject facet. Typically you would augment @Inject with your own facet to provide injection meta. See @ServiceId and @Autobuild for built-in examples.
Contribute DependencyProvider instances to the DependencyProviders service.
@Contribute { serviceType=DependencyProviders# }
static Void contributeDependencyProviders(OrderedConfig conf) {
serviceIdProvider := conf.autobuild(ServiceIdProvider#)
config.add(serviceIdProvider)
}
@since 1.1
- canProvide
abstract Bool canProvide(InjectionCtx injectionCtx)Return
trueif the provider can provide. (!)- provide
abstract Obj? provide(InjectionCtx injectionCtx)Return the dependency to be injected. All details of the injection to be performed is in
InjectionCtx.