public class BeanRegistry extends java.lang.Object implements BeansProvider
BeansProvider that holds and provides beans which were explicitly registered before.
The BeanRegistry supports the and
by default.
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getPreferredBeanName(java.lang.Class<?> beanClass) |
<T> T |
lookUpBean(java.lang.Class<T> type)
Looks up a bean of the given type.
|
<T> T |
lookUpBean(java.lang.String name,
java.lang.Class<T> type)
Looks up the bean with the given name and type.
|
<T> java.util.List<T> |
lookUpBeans(java.lang.Class<T> type)
Looks up all beans of the given type in the
BeanRegistry of this application. |
public <T> T lookUpBean(java.lang.String name,
java.lang.Class<T> type)
BeansProvider
If no bean with that name is registered or the registered bean is not assignable to the required type,
null is returned.
lookUpBean in interface BeansProviderT - the bean-typename - the name of the desired beantype - the type of the desired beannullpublic <T> T lookUpBean(java.lang.Class<T> type)
BeansProvider
If no bean is assignable to the required type, null is returned. If multiple beans are assignable to the
required type, the first match is returned.
lookUpBean in interface BeansProviderT - the bean-typetype - the type of the desired beannullpublic <T> java.util.List<T> lookUpBeans(java.lang.Class<T> type)
BeansProviderBeanRegistry of this application.lookUpBeans in interface BeansProviderT - the bean-typetype - the type of the desired beanspublic static java.lang.String getPreferredBeanName(java.lang.Class<?> beanClass)