更新時間:2022-03-24 10:55:27 來源:動力節點 瀏覽1182次
Spring切面編程表達式是什么樣的?小編來告訴大家。
execution(modifiers-pattern? ret-type-pattern declaring-type-pattern? name-pattern(param-pattern) throws-pattern?)
修飾符(modifiers-pattern) 返回值(ret-type-pattern) 方法的包名(declaring-type-pattern) 方法名(name-pattern) 方法參數(param-pattern) 拋出的異常類型(throws-pattern) 注:帶?表示可有可無
*代表通配符,可以代表任意類或任意字符 ,如果是在包名之間的..代表當前包和其子包
任意公共方法的執行:
execution(public * *(..))
任何一個以“find”開始的方法的執行:
execution(* find*(..))
UserService 接口的任意方法的執行:
execution(* com.xxx.service.UserService .*(..))
service包里的任意方法的執行:
execution(* com.xyz.service.*.*(..))
service包和所有子包里的任意類的任意方法的執行:
execution(* com.xyz.service..*.*(..))
以上就是關于“Spring切面編程表達式”的介紹,大家如果想了解更多相關知識,可以關注一下動力節點的Java在線學習,里面的課程內容從入門到精通,細致全面,通俗易懂,很適合沒有基礎的朋友學習,希望對大家能夠有所幫助。
0基礎 0學費 15天面授
有基礎 直達就業
業余時間 高薪轉行
工作1~3年,加薪神器
工作3~5年,晉升架構
提交申請后,顧問老師會電話與您溝通安排學習