android-beans / rocks.frieler.android.beans / BeanConfigurationsBeansCollector

BeanConfigurationsBeansCollector

class BeanConfigurationsBeansCollector : BeansProvider

The BeanConfigurationsBeansCollector collects the beans defined by BeanConfigurations in a BeanRegistry.

The BeanConfigurationsBeansCollector also implements the BeansProvider-interface to provide dependencies to the BeanDefinitions being processed. Therefore it will provide beans that are already registered in the BeanRegistry and process further BeanDefinitions that can fulfill the dependency.

Author
Christopher Frieler

Functions

collectBeans

fun collectBeans(beanConfigurations: List<BeanConfiguration>): Unit

Collects beans from the given BeanConfigurations and registers them at the underlying BeanRegistry.

lookUpBeans

fun <T : Any> lookUpBeans(type: KClass<T>): List<T>

Provides all beans of the given type from the underlying BeanRegistry. Additionally, to ensure that the result contains all such beans, processes the remaining BeanDefinitions that will produce a bean of that type.

lookUpOptionalBean

fun <T : Any> lookUpOptionalBean(name: String, type: KClass<T>): T?

Provides a bean by name and type from the underlying BeanRegistry or, if there is no such bean yet, processes further BeanDefinitions that can produce that bean.

fun <T : Any> lookUpOptionalBean(type: KClass<T>): T?

Provides a bean by type from the underlying BeanRegistry or, if there is no such bean yet, processes further BeanDefinitions that can produce that bean.

Inherited Functions

lookUpBean

open fun <T : Any> lookUpBean(name: String, type: KClass<T>): T

Looks up the bean with the given name and type.

open fun <T : Any> lookUpBean(name: String, type: Class<T>): T

Looks up the bean with the given name and Java type.

open fun <T : Any> lookUpBean(type: KClass<T>): T

Looks up a bean of the given type.

open fun <T : Any> lookUpBean(type: Class<T>): T

Looks up a bean of the given Java type.

lookUpBeans

open fun <T : Any> lookUpBeans(type: Class<T>): List<T>

Looks up all beans of the given Java type in the BeanRegistry of this application.

lookUpOptionalBean

open fun <T : Any> lookUpOptionalBean(name: String, type: Class<T>): T?

Looks up the bean with the given name and Java type.

open fun <T : Any> lookUpOptionalBean(type: Class<T>): T?

Looks up a bean of the given Java type.