public static boolean matches(Pointcut pointcut,
Method method,
Class targetClass,
Object[] args) {
Assert.notNull(pointcut, "Pointcut must not be null");
if (pointcut == Pointcut.TRUE) {
return true;
}
if (pointcut.getClassFilter().matches(targetClass)) {
// Only check if it gets past first hurdle.
MethodMatcher mm = pointcut.getMethodMatcher();
if (mm.matches(method, targetClass)) {
// We may need additional runtime (argument) check.
return (!mm.isRuntime() || mm.matches(method, targetClass, args));
}
}
return false;
}
Perform the least expensive check for a pointcut match. |