android-beans / rocks.frieler.android.beans.scopes / GenericScopedFactoryBean

GenericScopedFactoryBean

open class GenericScopedFactoryBean<T : Any> : ScopedFactoryBean<T>

Generic implementation for ScopedFactoryBean.

Author
Christopher Frieler

Constructors

<init>

GenericScopedFactoryBean(scope: String, beanType: KClass<T>, producer: BeansProvider.() -> T)

Generic implementation for ScopedFactoryBean.

Properties

beanType

open val beanType: KClass<T>

Returns the type of the bean produced by this ScopedFactoryBean.

scope

open val scope: String

Returns the name of the scope, where the bean produced by this ScopedFactoryBean lives in.

Functions

produceBean

open fun produceBean(dependencies: BeansProvider): T

Produces a new bean of type T.

Extension Functions

decorate

fun <T : Any> ScopedFactoryBean<T>.decorate(): ScopedFactoryBeanDecorator<T>

Inheritors

ActivityScopedFactoryBean

class ActivityScopedFactoryBean<T : Any> : GenericScopedFactoryBean<T>

ScopedFactoryBean for beans of the ActivityScopedFactoryBeanHandler.ACTIVITY_SCOPE-scope.

PrototypeScopedFactoryBean

class PrototypeScopedFactoryBean<T : Any> : GenericScopedFactoryBean<T>

ScopedFactoryBean for beans of the PrototypeScopedFactoryBeanHandler.PROTOTYPE_SCOPE-scope.

SingletonScopedFactoryBean

class SingletonScopedFactoryBean<T : Any> : GenericScopedFactoryBean<T>

ScopedFactoryBean for beans of the singleton-scope.