如何在方面获取参数名称,例如,如果我的方法是test(Sample sampleDto),我需要知道我方面中sampleDto的名称。如何从ProceedingJoinPoint获得它? 我试试这个,但我得到了。
String[] argumentsName = ((MethodSignature) proceedingJoinPoint.getSignature()).getParameterNames()
答案 0 :(得分:0)
试过这个并且有效
Reporter.log(gson.toJson(((MethodSignature) jp.getSignature()).getParameterNames()), true);
Reporter.log(gson.toJson(jp.getArgs()), true);
输出
[
"externalOrderId",
"tenderDto",
"checksum",
"cookieToken"
]
[
"C605600399",
{
"number": "XXXXXXXXXXXXXXXX",
"expiration": "XXXXXX",
"pin": "XXX",
"type": "CREDITCARD"
},
1514412484857,
"50113963101%2CP08rS1wzJiYqQEA3ODEkQVZWLy8sTksmMyNPJH4mXj0jQi1KOThfTld%2BQCQh"
]