package com.yichao.woo.spring.aop.pointcut; import org.springframework.aop.ClassFilter; import org.springframework.aop.support.StaticMethodMatcherPointcut; import java.lang.reflect.Method; public class SimpleStaticPointCut extends StaticMethodMatcherPointcut { @Override public boolean matches(Method method, Class<?> targetClass) { return "foo".equals(method.getName()); } public ClassFilter getClassFilter() { return new ClassFilter() { @Override public boolean matches(Class<?> clazz) { return (clazz == BeanOne.class); } }; } }