How to get method parameter in method without aspect

你。 提交于 2019-12-24 08:46:47

问题


public class Test {

    private static void aMethod(String a, int i) {

        printParam();

    }

    private static void aMethod(String a) {

        printParam();

    }

    private static void printParam() {
        //System.out.println(gson.toJson(MethodInvocation.getArguments()));
    }
}

Is there a way, like MethodInvocation.getArguments but not use aspect(as in the print log case, the method is Changeable, so it's not that convenient), to find out the method's invocation point and print out the method parameters' value without considering the count and type of the parameters?

来源:https://stackoverflow.com/questions/42570583/how-to-get-method-parameter-in-method-without-aspect

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!