Map of method arguments in Java -


this question has answer here:

is there way can retrieve arguments/parameters of method inside method in map key parameter name , value parameter value?

say, have method below signature:

public void do(string arg1, int arg2, string arg3, double arg4, mycustomobj arg5) 

i want achieve this:

public void do(string arg1, int arg2, string arg3, double arg4, mycustomobj arg5) {
map<string, object> argsmap = <what-goes-here>; logger.info("do entry: "+argsmap); }

ps: not looking solution based on aop. want can used within method itself.

update: question not how values via reflection. please re-read before marking duplicate.

this seems candidate of aop , with spring apply before advice, create own map , print it.


Comments