I created custom annotation @MyAnn
. And I will annotate method parameters with it.
For example: public static call(@MyAnn String name){...}
Using AspectJ, how can I access and update the values of all parameters annotated with the annotation?
I found some sample code showing how to create pointcuts targeting custom annotations, here.
So for now, I created an aspect with a pointcut.
But I don't know hot to get value of parameter annotated with MyAnn
.
@Aspect
public class MyAnnAspect {
@Around("execution(@my.package.test.MyAnn") // I hope this pointcut will work
public void changeParameter(final ProceedingJoinPoint pjp) throws Throwable {
// How I can there get parameter value (and chage it)?
}
}