Spring currently doesn't have a public API for finding beans based on generics type information. Generic types seem to only be supported in autowiring fields or methods (Spring blog article).
String[] getBeanNamesForType(ResolvableType resolvableType);
<T> Map<String, T> getBeansOfType(Class<T> type, ResolvableType resolvableType) throws BeansException;
<T> Map<String, T> getBeansOfType(Class<T> type, ResolvableType resolvableType, boolean includeNonSingletons, boolean allowEagerInit) throws BeansException;
Lari Hotari opened SPR-12147 and commented
Spring currently doesn't have a public API for finding beans based on generics type information. Generic types seem to only be supported in autowiring fields or methods (Spring blog article).
There is a discussion about this feature in the issue comments of SPR-9965 .
I'd like to have generics support in ListableBeanFactory:
Affects: 4.0.6, 4.1 RC2
Issue Links:
Referenced from: commits b230892, 778a019
0 votes, 11 watchers