jeudi 2 mars 2017

How to get method parameter in method without aspect

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?





Aucun commentaire:

Enregistrer un commentaire