android-beans / rocks.frieler.android.beans / HierarchicalBeansProvider

HierarchicalBeansProvider

abstract class HierarchicalBeansProvider : BeansProvider

Abstract BeansProvider that provides beans from a parent BeansProvider additionally or as fallback.

Constructors

<init>

HierarchicalBeansProvider(parent: BeansProvider? = null)

Abstract BeansProvider that provides beans from a parent BeansProvider additionally or as fallback.

Functions

lookUpBeans

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

Looks up all beans of the given type locally and in the parent.

lookUpLocalBeans

abstract fun <T : Any> lookUpLocalBeans(type: KClass<T>): List<T>

Looks up all beans of the given type solely locally, i.e. not in the parent.

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 the bean with the given type.

lookUpOptionalLocalBean

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

Looks up the bean with the given name and type locally, i.e. solely in this BeansProvider, not in the parent, following the same contract as BeansProvider.lookUpOptionalBean.

abstract fun <T : Any> lookUpOptionalLocalBean(type: KClass<T>): T?

Looks up the bean with the given type locally, i.e. solely in this BeansProvider, not in the parent, following the same contract as BeansProvider.lookUpOptionalBean.

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.

Inheritors

BeanRegistry

class BeanRegistry : HierarchicalBeansProvider

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