문제

I have several functions which receive Strings as parameters. I need to create a pointcut that captures one of those parameters. This parameter is in different order in the different functions, but it's always called idTaller.

This is what I have tried so far:

public aspect TallerWSAspect {
    pointcut webservice(String idTaller) : execution(!static public * TallerWS.*(String,..)) && args(idTaller,..);
    }   
}

This pointcut captures a method whose first parameter is a String, and captures it with the name idTaller.

Is there a way to select which parameter I want to capture?

도움이 되었습니까?

해결책

i think you can only capture by type as per

https://eclipse.org/aspectj/doc/next/quick5.pdf

however, you can use reflection in aspects to read the parameters, and pick out the one you want.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top