Skip to content

Provide a way to predict bean types without initializing FactoryBeans #23374

Closed
@philwebb

Description

@philwebb

See this comment for details.

I don't think we currently have a way to tell the predicted type of a bean without initializing it. It might be nice if we could either surface a getType(String name, boolean allowEagerInit) or perhaps add a callback based approach similar to the existing getBeanNames... methods:

<T> void doWithBeanNamesForType(@Nullable Class<T> type, boolean includeNonSingletons, boolean allowEagerInit, BiConsumer<String, Class<T>> consumer);

We should wait until #23341 is merged before taking this on.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions