反射实现Spring中的@Autowired注解

 1.总体思路 1.拿到运行时对象 2.拿到类中的全部属性值java 3.判断属性值上面是否有自定义的autowired注解 4.获取属性对应的类 5.实例化对象 6.经过反射给运行时对象的属性赋值this  2.自定义注解 @Retention(value = RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interfac
相关文章
相关标签/搜索