Skip to content

Add generics / parameterized type support to ListableBeanFactory getBeanNamesForType/getBeansOfType methods [SPR-12147] #16761

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

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;

Affects: 4.0.6, 4.1 RC2

Issue Links:

Referenced from: commits b230892, 778a019

0 votes, 11 watchers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions