10 2021 档案

ApplicationContext在非Service类中调用Spring的Serivce类
摘要:背景 有时我们需要在一些不属于Spring的类中,去调用Spring的Service类的方法。 比如,在Util类,或者main()方法中,去调用Service类的方法。 这时,可以使用 ApplicationContextAware接口 和 ApplicationContext接口 . Appli 阅读全文

posted @ 2021-10-25 11:57 乐之者v 阅读(201) 评论(0) 推荐(0) 编辑

PropertyDescriptor动态反射setter和getter设置对象属性
摘要:PropertyDescriptor 我们在开发的过程中,有时会需要动态地设置属性,也就是动态getter、 setter。 使用传统的反射 Method、Field等类去处理,需要对方法名进行大量拼接,比较麻烦。 可以使用 PropertyDescriptor. 常用方法: 构造方法: Prope 阅读全文

posted @ 2021-10-19 19:41 乐之者v 阅读(803) 评论(0) 推荐(0) 编辑

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

导航

统计

点击右上角即可分享
微信分享提示