Spring源码-HierarchicalBeanFactory-源码解读

/**
 * Sub-interface implemented by bean factories that can be part		由 bean factory 实现的子接口,等级制度的一部分
 * of a hierarchy.
 *
 * <p>The corresponding {@code setParentBeanFactory} method for bean可以在 ConfigurableBeanFactory 接口中
 * factories that allow setting the parent in a configurable		通过 setParentBeanFactory 方法用于以可配置的方式设置父级的 bean factory
 * fashion can be found in the ConfigurableBeanFactory interface.
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @since 07.07.2003
 * @see org.springframework.beans.factory.config.ConfigurableBeanFactory#setParentBeanFactory
 */
public interface HierarchicalBeanFactory extends BeanFactory {

	/**
	 * Return the parent bean factory, or {@code null} if there is none.
	 * 返回父 bean factory,如果是空的话返回 null
	 */
	@Nullable
	BeanFactory getParentBeanFactory();

	/**
	 * Return whether the local bean factory contains a bean of the given name,		给定一个 name 返回本地 bean factory 是否包含一个 bean
	 * ignoring beans defined in ancestor contexts.									忽略在祖先 contexts 中的定义的 bean
	 * <p>This is an alternative to {@code containsBean}, ignoring a bean			这是来自 containsBean 的另一种选择,给一个 name 忽略祖先 bean factory 中的 bean
	 * of the given name from an ancestor bean factory.
	 * @param name the name of the bean to query
	 * @return whether a bean with the given name is defined in the local factory	给定名字的定义是否在本地 factory 中被定义
	 * @see BeanFactory#containsBean
	 */
	boolean containsLocalBean(String name);

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值