android-beans / rocks.frieler.android.beans.scopes.prototype / PrototypeScopedFactoryBean

PrototypeScopedFactoryBean

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

ScopedFactoryBean for beans of the PrototypeScopedFactoryBeanHandler.PROTOTYPE_SCOPE-scope.

Author
Christopher Frieler

Constructors

<init>

PrototypeScopedFactoryBean(type: KClass<T>, producer: BeansProvider.() -> T)

ScopedFactoryBean for beans of the PrototypeScopedFactoryBeanHandler.PROTOTYPE_SCOPE-scope.

Inherited 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.

Inherited Functions

produceBean

open fun produceBean(dependencies: BeansProvider): T

Produces a new bean of type T.

Companion Object Functions

prototype

fun <T : Any> prototype(type: Class<T>, producer: () -> T): BeanDefinition<PrototypeScopedFactoryBean<*>>

Provides a BeanDefinition for a PrototypeScopedFactoryBean that produces a bean of the given type using the given producer without dependencies.

fun <T : Any> prototype(type: Class<T>, producer: BeansProvider.() -> T): BeanDefinition<PrototypeScopedFactoryBean<*>>

Provides a BeanDefinition for a PrototypeScopedFactoryBean that produces a bean of the given type using the given producer with dependencies.

Extension Functions

decorate

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