第 05 章:一鸣惊人,为Bean对象注入属性和依赖Bean的功能实现

pull/52/head
小傅哥 2 years ago
parent 391f7c93b9
commit 8701551804
  1. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/BeansException.java
  2. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/PropertyValue.java
  3. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/PropertyValues.java
  4. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/BeanFactory.java
  5. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/config/BeanDefinition.java
  6. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/config/BeanReference.java
  7. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/config/SingletonBeanRegistry.java
  8. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
  9. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/support/AbstractBeanFactory.java
  10. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/support/BeanDefinitionRegistry.java
  11. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/support/DefaultListableBeanFactory.java
  12. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java
  13. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/support/InstantiationStrategy.java
  14. 5
      small-spring-step-04/src/main/java/cn/bugstack/springframework/beans/factory/support/SimpleInstantiationStrategy.java
  15. 5
      small-spring-step-04/src/test/java/cn/bugstack/springframework/test/ApiTest.java
  16. 5
      small-spring-step-04/src/test/java/cn/bugstack/springframework/test/bean/UserService.java

@ -1,11 +1,6 @@
package cn.bugstack.springframework.beans;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public class BeansException extends RuntimeException {

@ -1,11 +1,6 @@
package cn.bugstack.springframework.beans;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*
* bean 属性信息

@ -4,11 +4,6 @@ import java.util.ArrayList;
import java.util.List;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public class PropertyValues {

@ -3,11 +3,6 @@ package cn.bugstack.springframework.beans.factory;
import cn.bugstack.springframework.beans.BeansException;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public interface BeanFactory {

@ -3,11 +3,6 @@ package cn.bugstack.springframework.beans.factory.config;
import cn.bugstack.springframework.beans.PropertyValues;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public class BeanDefinition {

@ -1,11 +1,6 @@
package cn.bugstack.springframework.beans.factory.config;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*
* Bean 的引用

@ -1,11 +1,6 @@
package cn.bugstack.springframework.beans.factory.config;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*
* 单例注册表

@ -13,11 +13,6 @@ import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFactory {

@ -5,11 +5,6 @@ import cn.bugstack.springframework.beans.factory.BeanFactory;
import cn.bugstack.springframework.beans.factory.config.BeanDefinition;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
* <p>
* BeanDefinition注册表接口

@ -3,11 +3,6 @@ package cn.bugstack.springframework.beans.factory.support;
import cn.bugstack.springframework.beans.factory.config.BeanDefinition;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public interface BeanDefinitionRegistry {

@ -7,11 +7,6 @@ import java.util.HashMap;
import java.util.Map;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFactory implements BeanDefinitionRegistry {

@ -6,11 +6,6 @@ import java.util.HashMap;
import java.util.Map;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {

@ -6,11 +6,6 @@ import cn.bugstack.springframework.beans.factory.config.BeanDefinition;
import java.lang.reflect.Constructor;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
* <p>
* Bean 实例化策略

@ -7,11 +7,6 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public class SimpleInstantiationStrategy implements InstantiationStrategy {

@ -16,11 +16,6 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public class ApiTest {

@ -1,11 +1,6 @@
package cn.bugstack.springframework.test.bean;
/**
* 博客https://bugstack.cn - 沉淀、分享、成长,让自己和他人都能有所收获!
* 公众号bugstack虫洞栈
* Create by 小傅哥(fustack)
*
* 来自于对开源项目的学习
* 作者DerekYRC https://github.com/DerekYRC/mini-spring
*/
public class UserService {

Loading…
Cancel
Save