I want to run an aspect using ElementType.PARAMETER
annotation but it does not work. The @Around tokenize
method is never called.
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface Tokenize {}
@Aspect
@Component
public class TokenizeAspect {
@Around("@annotation(Tokenize)")
public Object tokenize(ProceedingJoinPoint joinPoint) throws Throwable {
Object parameter = joinPoint.getArgs()[0];
return joinPoint.proceed();
}
}
public void addClientBankAccount(@Tokenize ClientBankAccountRequestCollection) {}