spring-framework / org.springframework.beans.factory.support / PropertiesBeanDefinitionReader / setDefaultParentBean

setDefaultParentBean

open fun setDefaultParentBean(@Nullable defaultParentBean: String): Unit

Set the default parent bean for this bean factory. If a child bean definition handled by this factory provides neither a parent nor a class attribute, this default value gets used.

Can be used e.g. for view definition files, to define a parent with a default view class and common attributes for all views. View definitions that define their own parent or carry their own class can still override this.

Strictly speaking, the rule that a default parent setting does not apply to a bean definition that carries a class is there for backwards compatibility reasons. It still matches the typical use case.