日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Spring(5) -(14) pointcut 语法

發(fā)布時間:2024/10/8 编程问答 34 如意码农
生活随笔 收集整理的這篇文章主要介紹了 Spring(5) -(14) pointcut 语法 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

AOP的規(guī)范本應該由SUM公司提出,但是被AOP聯(lián)盟捷足先登.AOP聯(lián)盟指定AOP規(guī)范,首先就要解決一個問題,怎么表示切入點,也就是在哪些方法上增強(where)

AspectJ 是一個面向切面的框架:

AspectJ切入點語法如下:
(表示在哪些包下的哪些類的哪些方法做切入增強)
execution(modifiners-pattern?ret-type-pattern declaring-type-pattern? name-param(param-patterm)throws-pattern?) ?
表示:該參數(shù)可以出現(xiàn)一次或零次
翻譯成中文: execution(<修飾符>?<返回類型> <聲明類型>?<方法名>(<參數(shù)>)<異常>?)
舉例:public static Class java.lang.Class.forName(String className) throws ClassNotFoundException
 

通配符

*

匹配任何部分,只能表示一個單詞

..

可用于全限定名中和方法參數(shù)中,分別表示子包和0到N個參數(shù)

spring-core 文檔中的例子

Some examples of common pointcut expressions are given below.
the execution of any public method:
execution(public * *(..)) the execution of any method with a name beginning with "set":
execution(* set*(..)) the execution of any method defined by the AccountService interface:
execution(* com.xyz.service.AccountService.*(..))//常用 the execution of any method defined in the service package:
execution(* com.xyz.service.*.*(..))//常用 the execution of any method defined in the service package or a sub-package:
execution(* com.xyz.service..*.*(..))//常用

作者:小白201808
鏈接:https://www.jianshu.com/p/f82b6933d78f
來源:簡書
簡書著作權歸作者所有,任何形式的轉載都請聯(lián)系作者獲得授權并注明出處。

總結

以上是生活随笔為你收集整理的Spring(5) -(14) pointcut 语法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。