0
点赞
收藏
分享

微信扫一扫

Spring的BeanPostProcessor扩展点实现类CommonAnnotationBeanPostProcessor

你的益达233 2022-01-26 阅读 80

CommonAnnotationBeanPostProcessor

postProcessPropertyValues

    @Deprecated
	@Override
	public PropertyValues postProcessPropertyValues(
			PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) {
		return postProcessProperties(pvs, bean, beanName);
	}

postProcessProperties

	@Override
	public PropertyValues postProcessProperties(PropertyValues pvs, Object bean, String beanName) {
		InjectionMetadata metadata = findResourceMetadata(beanName, bean.getClass(), pvs);
		try {
			metadata.inject(bean, beanName, pvs);
		}
		catch (Throwable ex) {
			throw new BeanCreationException(beanName, "Injection of resource dependencies failed", ex);
		}
		return pvs;
	}
举报

相关推荐

0 条评论