/**
* Creates an instance of the bean.
*
* @return the created instance
*
* @throws Exception
* if the instance cannot be created
*/
protected Object createInstance() throws Exception {
final Constructor<?> constructor = findMatchingConstructor();
final Object object = constructor.newInstance(constArgs);
// check if we have to apply properties
if (properties != null && properties.size() > 0) {
new BeanWrapperImpl(object).setPropertyValues(values);
}
// auto-wire everything if the factory supports that
if (beanFactory instanceof AutowireCapableBeanFactory) {
((AutowireCapableBeanFactory) beanFactory).autowireBeanProperties(
object, AutowireCapableBeanFactory.AUTOWIRE_NO, false);
}
return object;
}
BeanCreator.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:gen-sbconfigurator
作者:
评论列表
文章目录