public interface BeansProvider
Beans are simple Java objects, that get registered with a name and can be looked up either by their name or type to inject them as dependencies (DI).
| Modifier and Type | Method and Description |
|---|---|
<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. |
<T> T lookUpBean(java.lang.String name,
java.lang.Class<T> type)
If no bean with that name is registered or the registered bean is not assignable to the required type,
null is returned.
T - the bean-typename - the name of the desired beantype - the type of the desired beannull<T> T lookUpBean(java.lang.Class<T> type)
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.
T - the bean-typetype - the type of the desired beannull<T> java.util.List<T> lookUpBeans(java.lang.Class<T> type)
BeanRegistry of this application.T - the bean-typetype - the type of the desired beans