Spring - 工厂Bean
工厂Bean
/*User工厂Bean*/ @Component public class UserFactory implements FactoryBean<User> { /*返回*/ public User getObject() throws Exception { User user=new User(); return user; } public Class<?> getObjectType() { return null; } /*是否为单例*/ public boolean isSingleton() { return false; } }