Spring源码分析

BeanDefinition

image

实例化Bean,使用反射 BeanDefinition-->Bean
反射可以获取对象的注解、构造器、属性等信息。

Class<?> userClass = Class.forName("com.nisco.system.entity.User");
Constructor<?> constructor = userClass.getConstructor();
Object user = constructor.newInstance();
System.out.println(user);

image

PostProcessor

修改BeanDefinition信息

class BeanPostProcessor {
	default Object postProcessBeforeInitialization(Object bean, String beanName);
	default Object postProcessAfterInitialization(Object bean, String beanName);
}

image

PlaceholderConfigurerSupport

x

posted @ 2021-08-16 08:12  fight139  阅读(26)  评论(0编辑  收藏  举报