实用的工具类
文章平均质量分 59
程序员-晨夕
这个作者很懒,什么都没留下…
展开
-
判断切面是否可以应用到当前类——AopUtils工具类使用
AopUtils工具类canApply的使用AopUtils是spring自带的工具类,我们可以使用它去判断某个类是否可以应用我们设计的切面advisor1、canApply方法源代码如下 public static boolean canApply(Advisor advisor, Class<?> targetClass) { return canApply(advisor, targetClass, false); } public static原创 2021-04-02 13:41:44 · 746 阅读 · 0 评论 -
ClassPathScanningCandidateComponentProvider工具类的使用(findCandidateComponents方法)
ClassPathScanningCandidateComponentProvider工具类的简单使用1、扫描包资源先简单的尝试下发现组件功能 public static void main(String[] args) throws Exception{ //1创建对象,参数先写false ClassPathScanningCandidateComponentProvider classPathScanningCandidateComponentProvider原创 2021-03-17 10:55:17 · 1462 阅读 · 0 评论 -
spring中的工具类——GenericTypeResolver使用
泛型解析应用1、定义接口public interface MyInterface<T> { void testMethod(T event);}2、定义实现类public class MyImpl implements MyInterface<String>{ @Override public void testMethod(String event) { }}3、测试 public static void main(原创 2021-03-04 15:12:36 · 2310 阅读 · 5 评论