data class Scope
<init> |
Scope(id: ScopeID, _scopeDefinition: ScopeDefinition, _koin: Koin, _source: Any? = null) |
_instanceRegistry |
val _instanceRegistry: InstanceRegistry |
_koin |
val _koin: Koin |
_linkedScope |
val _linkedScope: ArrayList<Scope> |
_scopeDefinition |
val _scopeDefinition: ScopeDefinition |
_source |
val _source: Any? |
closed |
val closed: Boolean |
id |
val id: ScopeID |
bind |
Get instance of primary type P and secondary type S (not for scoped instances) fun <S, P> bind(parameters: ParametersDefinition? = null): Sfun <S> bind(primaryType: KClass<*>, secondaryType: KClass<*>, parameters: ParametersDefinition?): S |
close |
Close all instances from this scope fun close(): Unit |
declare |
Declare a component definition from the given instance This result of declaring a scoped/single definition of type T, returning the given instance (single definition of th current scope is root) fun <T : Any> declare(instance: T, qualifier: Qualifier? = null, secondaryTypes: List<KClass<*>>? = null, override: Boolean = false): Unit |
dropInstances |
fun dropInstances(scopeDefinition: ScopeDefinition): Unit |
get |
Get a Koin instance fun <T> get(qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): Tfun <T> get(clazz: KClass<*>, qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): Tfun <T> get(clazz: Class<*>, qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): T |
getAll |
Get a all instance for given inferred class (in primary or secondary type) fun <T : Any> getAll(): List<T>
Get a all instance for given class (in primary or secondary type) fun <T : Any> getAll(clazz: KClass<*>): List<T> |
getKoin |
Get current Koin instance fun getKoin(): Koin |
getOrNull |
Get a Koin instance if available fun <T> getOrNull(qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): T?fun <T> getOrNull(clazz: KClass<*>, qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): T? |
getProperty |
Retrieve a property fun getProperty(key: String, defaultValue: String): Stringfun getProperty(key: String): String |
getPropertyOrNull |
Retrieve a property fun getPropertyOrNull(key: String): String? |
getScope |
Get Scope fun getScope(scopeID: ScopeID): Scope |
getSource |
fun <T : Any> getSource(): T |
inject |
Lazy inject a Koin instance fun <T> inject(qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): Lazy<T> |
injectOrNull |
Lazy inject a Koin instance if available fun <T> injectOrNull(qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): Lazy<T?> |
linkTo |
Add parent Scopes to allow instance resolution i.e: linkTo(scopeC) - allow to resolve instance to current scope and scopeC fun linkTo(vararg scopes: Scope): Unit |
loadDefinitions |
fun loadDefinitions(scopeDefinition: ScopeDefinition): Unit |
registerCallback |
Register a callback for this Scope Instance fun registerCallback(callback: ScopeCallback): Unit |
toString |
fun toString(): String |
unlink |
Remove linked scope fun unlink(vararg scopes: Scope): Unit |