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

ScopedBeanDefinition

class ScopedBeanDefinition<F : ScopedFactoryBean<*>, T : Any> : BeanDefinition<F>

Special BeanDefinition for ScopedFactoryBeans that is also aware of the type of bean produced by the factory-bean.

Author
Christopher Frieler

Constructors

<init>

ScopedBeanDefinition(name: String? = null, factoryBeanType: KClass<F>, targetType: KClass<T>, creator: (BeansProvider) -> F)

Special BeanDefinition for ScopedFactoryBeans that is also aware of the type of bean produced by the factory-bean.

Functions

canProduce

fun canProduce(type: KClass<*>): Boolean

Indicates whether this ScopedBeanDefinition can produce a bean of the given type (or a subtype), either directly or indirectly when the ScopedFactoryBean produces its bean.

Inherited Functions

getName

fun getName(): String?

Returns the name for the defined bean or null if no name was specified explicitly.

getType

fun getType(): KClass<T>

Returns the type of the defined bean.

produceBean

fun produceBean(dependencyProvider: BeansProvider): T

Produces the bean by invoking the creator function.