In Java 6 , imagine that I have the following method signature:
public void makeSandwich(Bread slice1, Bread slice2, List<Filling> fillings, boolean mustard)
I would like to know, at runtime, the value passed to slice2 or any other parameter, the important bit here is that I want to get the value by the parameter name.
I know how to get a list of parameter types using getParameterTypes or getGenericParameterTypes .
Ideally, I would like to get a list of parameter names instead of types. Is there any way to do this?
java reflection runtime java-6
Tiago Veloso Jul 20 2018-11-11T00: 00Z
source share