use of org.springframework.aop.Pointcut in project druid by alibaba.
the class StatAnnotationAdvisor method buildPointcut.
protected Pointcut buildPointcut() {
Pointcut cpc = new AnnotationMatchingPointcut(Stat.class, true);
Pointcut mpc = AnnotationMatchingPointcut.forMethodAnnotation(Stat.class);
ComposablePointcut result = new ComposablePointcut(cpc).union(mpc);
return result;
}
use of org.springframework.aop.Pointcut in project spring-framework by spring-projects.
the class CallCountingInterceptor method testMultipleAndSubstitutions.
@Test
public void testMultipleAndSubstitutions() {
Pointcut pc = getPointcut("execution(* *(..)) and args(String) and this(Object)");
PointcutExpression expr = ((AspectJExpressionPointcut) pc).getPointcutExpression();
assertEquals("execution(* *(..)) && args(String) && this(Object)", expr.getPointcutExpression());
}
use of org.springframework.aop.Pointcut in project spring-framework by spring-projects.
the class CallCountingInterceptor method testAndSubstitution.
@Test
public void testAndSubstitution() {
Pointcut pc = getPointcut("execution(* *(..)) and args(String)");
PointcutExpression expr = ((AspectJExpressionPointcut) pc).getPointcutExpression();
assertEquals("execution(* *(..)) && args(String)", expr.getPointcutExpression());
}
use of org.springframework.aop.Pointcut in project spring-framework by spring-projects.
the class MethodValidationPostProcessor method afterPropertiesSet.
@Override
public void afterPropertiesSet() {
Pointcut pointcut = new AnnotationMatchingPointcut(this.validatedAnnotationType, true);
this.advisor = new DefaultPointcutAdvisor(pointcut, createMethodValidationAdvice(this.validator));
}
use of org.springframework.aop.Pointcut in project spring-framework by spring-projects.
the class AopUtilsTests method testPointcutCanNeverApply.
@Test
public void testPointcutCanNeverApply() {
class TestPointcut extends StaticMethodMatcherPointcut {
@Override
public boolean matches(Method method, Class<?> clazzy) {
return false;
}
}
Pointcut no = new TestPointcut();
assertFalse(AopUtils.canApply(no, Object.class));
}
Aggregations