我想在MethodInterceptor類中檢索參數的方法名稱。如何在MethodInterceptor中獲取方法的參數名稱?
public Object invoke(MethodInvocation invocation) throws Throwable {
Method method = invocation.getMethod();
Class<?> declaringClass = method.getDeclaringClass();
Logger logger = LoggerFactory.getLogger(declaringClass);
//here some treatment
return invocation.proceed();
}
我只是找不到如何用MethodInvocation實例檢索方法參數的名稱。我不知道這是可能的..