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

原文地址:https://www.cnblogs.com/zhuxiang1633/p/15145964.html