android-beans / rocks.frieler.android.beans / BeanRegistry

BeanRegistry

class BeanRegistry : BeansProvider

BeansProvider that holds and provides beans which were explicitly registered before.

The BeanRegistry supports the singleton and prototype scopes by default.

Author
Christopher Frieler

Functions

addBeanScope

fun addBeanScope(scopedFactoryBeanHandler: ScopedFactoryBeanHandler): Unit

Adds a bean-scope expressed by the given ScopedFactoryBeanHandler to this BeanRegistry.

lookUpBeans

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

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

lookUpOptionalBean

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

Looks up the bean with the given name and type.

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

Looks up a bean of the given type.

registerBean

fun registerBean(bean: Any): String

Registers the bean with a generated name at this BeanRegistry and returns this name.

fun registerBean(name: String, bean: Any): Unit

Registers the bean with the given name at this BeanRegistry.

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.