关于Spring Getter Setter注入的猜测

    在Spring中用到cglibenhance 类代码,猜测 BeanGet Set函数可能作过特殊处理,在Spring的源码中有好几个地方有这样的代码:函数

method.getName().startsWith("set"spa

method.getName().startsWith("get"))get

    猜测是加强了这样的方法,源码

    好比Spring中的AUTOWIRE_BY_NAME有多是经过名字一致,而后从BeanFactoryApplicationContext中获取到名字同样的Bean,而后作属性设置。it

    这个只是猜测,有时间了再回来翻代码验证下。io

相关文章
相关标签/搜索