Bean后置处理器 – InstantiationAwareBeanPostProcessor#postProcessAfterInstantiation

Bean后置处理器 - InstantiationAwareBeanPostProcessor#postProcessAfterInstantiation

代码片段:

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#populateBean

if (!mbd.isSynthetic() && hasInstantiationAwareBeanPostProcessors()) {
    for (BeanPostProcessor bp : getBeanPostProcessors()) {
        if (bp instanceof InstantiationAwareBeanPostProcessor) {
            InstantiationAwareBeanPostProcessor ibp = (InstantiationAwareBeanPostProcessor) bp;
            //如果返回为 false, 则会终止属性注入
            if (!ibp.postProcessAfterInstantiation(bw.getWrappedInstance(), beanName)) {
                return;
            }
        }
    }
}
hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » Bean后置处理器 – InstantiationAwareBeanPostProcessor#postProcessAfterInstantiation