class Builder
enum class SubcomponentIncludeMode |
val qualifier: Any |
fun <R0 : Any, R1 : Any> alias(targetKey: TypeKey<R0>, newKey: TypeKey<R1>, override: Boolean = false): TypeKey<R0>
Create an alias entry. fun <R : Any> TypeKey<*>.alias(aliasQualifier: Any? = null, generics: Boolean = false, override: Boolean = false): TypeKey<*>
Create an alias entry for a TypeKey. |
|
fun allowComponentQualifier(qualifier: Any, block: () -> Unit): Unit
Allow a different component qualifier than qualifier for include and Factory.register. |
|
fun checkComponentQualifier(qualifier: Any): Unit
Checks if the given qualifier meets criteria for include and Factory.register. |
|
fun <R : Any> constant(value: R, qualifier: Any? = null, generics: Boolean = false, override: Boolean = false): TypeKey<R>
Register a constant of type R. |
|
fun <R : Any> eagerSingleton(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false, onPostConstruct: GFactoryCallback<R>? = null, onClose: GFactoryCallback<R>? = null, factory: GFactory<R>): TypeKey<R>
Register an eager singleton scoped factory for an instance of type R. |
|
fun <R : Any> generated(override: Boolean = false): TypeKey<R>
Register a generated factory. |
|
fun <R : Any> generatedFactory(): Factory<R>
Loads the generated factory of the given type. |
|
fun include(component: Component, override: Boolean = true, subcomponentIncludeMode: Component.Builder.SubcomponentIncludeMode = SubcomponentIncludeMode.Merge): Unit
Include dependency from the given component into the new component. |
|
fun <R : Any> mapOfProvidersForType(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false, defaultKey: Any = "default"): TypeKey<Map<Any, Provider<R>>>
Register a service that resolves a map of qualifiers to providers for type R. |
|
fun <R : Any> mapOfType(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false, defaultKey: Any = "default"): TypeKey<Map<Any, R>>
Register a service that resolves a map of qualifiers to type R. |
|
fun <R : Any> prototype(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false, onPostConstruct: GFactoryCallback<R>? = null, factory: GFactory<R>): TypeKey<R>
Register a prototype scoped factory for an instance of type R. |
|
fun register(service: UnboundService<*>, override: Boolean): Unit
Register a UnboundService. |
|
fun remove(key: TypeKey<*>, silent: Boolean = false): Unit
Remove a dependency from the component. Throws an EntryNotFoundException if the dependency doesn't exist and silent is false. |
|
fun <R : Any> setOfProvidersForType(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false): TypeKey<Set<Provider<R>>>
Register a service that resolves a set of providers for type R. |
|
fun <R : Any> setOfType(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false): TypeKey<Set<R>>
Register a service that resolves a set of instance of type R. |
|
fun <R : Any> singleton(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false, onPostConstruct: GFactoryCallback<R>? = null, onClose: GFactoryCallback<R>? = null, factory: GFactory<R>): TypeKey<R>
Register a singleton scoped factory for an instance of type R. |
|
fun <R : Any> softSingleton(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false, onPostConstruct: GFactoryCallback<R>? = null, factory: GFactory<R>): TypeKey<R>
Register a soft singleton scoped factory for an instance of type R. |
|
fun subcomponent(qualifier: Any, override: Boolean = false, deriveExisting: Boolean = false, block: Component.Builder.() -> Unit): Unit
Register a subcomponent. |
|
fun <R : Any> weakSingleton(qualifier: Any? = null, generics: Boolean = false, override: Boolean = false, onPostConstruct: GFactoryCallback<R>? = null, factory: GFactory<R>): TypeKey<R>
Register a weak singleton scoped factory for an instance of type R. |