1 Star 0 Fork 156

南风不竞 / Spring-Analysis

forked from huifer / Code-Analysis 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Spring-NamedBeanHolder.md 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
huifer 提交于 2020-12-11 12:43 . feat: 0.0.11

Spring NamedBeanHolder

  • 类全路径: org.springframework.beans.factory.config.NamedBeanHolder

成员变量

  1. beanName
  2. bean 实例

public class NamedBeanHolder<T> implements NamedBean {
    /**
     * bean name
     */
    private final String beanName;

    /**
     * bean 实例
     */
    private final T beanInstance;

}

完整代码

public class NamedBeanHolder<T> implements NamedBean {
	/**
	 * bean name
	 */
	private final String beanName;

	/**
	 * bean 实例
	 */
	private final T beanInstance;


	/**
	 * Create a new holder for the given bean name plus instance.
	 * @param beanName the name of the bean
	 * @param beanInstance the corresponding bean instance
	 */
	public NamedBeanHolder(String beanName, T beanInstance) {
		Assert.notNull(beanName, "Bean name must not be null");
		this.beanName = beanName;
		this.beanInstance = beanInstance;
	}


	/**
	 * Return the name of the bean.
	 */
	@Override
	public String getBeanName() {
		return this.beanName;
	}

	/**
	 * Return the corresponding bean instance.
	 */
	public T getBeanInstance() {
		return this.beanInstance;
	}

}
Java
1
https://gitee.com/limengcanyu/spring-analysis.git
git@gitee.com:limengcanyu/spring-analysis.git
limengcanyu
spring-analysis
Spring-Analysis
master

搜索帮助