首页 > 其他 > 详细

@Pointcut的表达式-@annotation

时间:2021-06-08 17:17:37      阅读:21      评论:0      收藏:0      [点我收藏+]

可以参考@Transtactional的具体实现。

限制连接点的匹配,其中连接点的主题(在 Spring AOP 中执行的方法)具有给定的 annotation。

官方案例:

任何连接点(仅在 Spring AOP 中执行方法),其中执行方法具有@Transactional annotation:

@annotation(org.springframework.transaction.annotation.Transactional)

官方的案例已经说的很清楚了,就是@annotation是匹配拥有指定注解的方法的。这里要注意,@annotation只匹配实现类中的有注解的方法,不会匹配接口中的注解方法。

参考:

https://www.cnblogs.com/jiafa/p/13835951.html

@Pointcut的表达式-@annotation

原文:https://www.cnblogs.com/zhf123/p/14862426.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!