1.工厂bean
package com.cj.spring5; import org.springframework.beans.factory.FactoryBean; public class MyBean implements FactoryBean<Course> { //定义返回的bean @Override public Course getObject() throws Exception { Course course = new Course("好看的书"); return course; } @Override public Class<?> getObjectType() { return null; } @Override public boolean isSingleton() { return false; } }
标签:return,工厂,Course,bean,Override,public,spring5 From: https://www.cnblogs.com/cciscc/p/16600486.html