目录
[execution(访问修饰符? 返回值 包名.类名.?方法名(方法参数) throws 异常?)](#execution(访问修饰符? 返回值 包名.类名.?方法名(方法参数) throws 异常?))
[@annotation(com.itheima.anno.Log](#@annotation(com.itheima.anno.Log)
第一种
execution(访问修饰符? 返回值 包名.类名.?方法名(方法参数) throws 异常?)
这种有两个通配符:* 和**..**
..:一般用在匹配方法里面的参数个数,表示任意个参数都进行匹配
*:表示任意的包或者方法
例如:

第二种
@annotation(com.itheima.anno.Log
首先,自定义一个注解,可以自己随意命名:
java
package com.zaizai.aop;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MyLog {
}
定义好接口之后,你只需要在你需要APO的业务层加上这个接口:

最后只用在APO类里面调用就可以了:
