更新時間:2022-03-24 10:55:27 來源:動力節(jié)點 瀏覽1279次
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) 方法參數(shù)(param-pattern) 拋出的異常類型(throws-pattern) 注:帶?表示可有可無
*代表通配符,可以代表任意類或任意字符 ,如果是在包名之間的..代表當前包和其子包
任意公共方法的執(zhí)行:
execution(public * *(..))
任何一個以“find”開始的方法的執(zhí)行:
execution(* find*(..))
UserService 接口的任意方法的執(zhí)行:
execution(* com.xxx.service.UserService .*(..))
service包里的任意方法的執(zhí)行:
execution(* com.xyz.service.*.*(..))
service包和所有子包里的任意類的任意方法的執(zhí)行:
execution(* com.xyz.service..*.*(..))
以上就是關(guān)于“Spring切面編程表達式”的介紹,大家如果想了解更多相關(guān)知識,可以關(guān)注一下動力節(jié)點的Java在線學(xué)習(xí),里面的課程內(nèi)容從入門到精通,細致全面,通俗易懂,很適合沒有基礎(chǔ)的朋友學(xué)習(xí),希望對大家能夠有所幫助。
初級 202925
初級 203221
初級 202629
初級 203743