Spring之FactoryBean
程序员文章站
2022-05-23 18:06:02
...
介绍
FactoryBean是用来构造Bean的接口。
源码
package org.springframework.beans.factory;
public interface FactoryBean<T> {
/**
* Return an instance (possibly shared or independent) of the object
* managed by this factory.
* 返回由FactoryBean管理的对象实例
*/
T getObject() throws Exception;
/**
* Return the type of object that this FactoryBean creates,
* or {@code null} if not known in advance.
* 返回对象实例的类型
*/
Class<?> getObjectType();
/**
* Is the object managed by this factory a singleton?
*/
boolean isSingleton();
参考文档:
上一篇: Spring之FactoryBean
推荐阅读