You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MyAspect.java 590B

1234567891011121314151617181920
  1. package com.example;
  2. import org.aspectj.lang.ProceedingJoinPoint;
  3. import org.aspectj.lang.annotation.Around;
  4. import org.aspectj.lang.annotation.Aspect;
  5. import org.aspectj.lang.annotation.Pointcut;
  6. @Aspect
  7. public class MyAspect {
  8. @Pointcut("execution(* *(..,@MyParameterAnnotation (String),..))")
  9. public void anyMethodCallWithMyParameterAnnotation() {
  10. }
  11. @Around("anyMethodCallWithMyParameterAnnotation()")
  12. public Object aroundMethodWithMyParameterAnnotation(ProceedingJoinPoint pjp) throws Throwable {
  13. throw new RuntimeException("OK");
  14. }
  15. }