---
title: "aop:pointcut expression解析"
author: "a_bin"
date: "2012-03-28T13:34:40Z"
tags: []
categories: ["编程语言"]
slug: "aop-pointcut-expression"
draft: false
lastmod: "2012-03-28T13:37:03Z"
id: 1466176
url: "https://a-bin.iteye.com/blog/1466176"
---

execution（* com.aptech.jb.epet.dao.hibimpl.\*.\*（..））

如许写应当就可以了 这是com.aptech.jb.epet.dao.hibimpl 包下所有的类的所有办法。。

第一个\*代表所有的返回值类型

第二个\*代表所有的类

第三个\*代表类所有办法 最后一个..代表所有的参数。

 

下面给出一些常见切入点表达式的例子。

 

随便率性公共办法的履行：

execution（public * \*（..））

 

任何一个以“set”开端的办法的履行：

execution（* set\*（..））

 

AccountService 接口的随便率性办法的履行：

execution（* com.xyz.service.AccountService.\*（..））

 

定义在service包里的随便率性办法的履行：

execution（* com.xyz.service.\*.\*（..））

 

定义在service包或者子包里的随便率性类的随便率性办法的履行：

execution（* com.xyz.service..\*.\*（..））