How do I get method signatures with Java reflection?
EDIT: I actually need the parameter NAMES not the types of a method.
To get the method i of a class C you call C.class.getMethods()[i].toString()
.
EDIT: Obtaining parameter names is not possible using the reflection API.
But wen you compiled your class with debug information, it is possible to extract the information from bytecode. Spring does it using the ASM bytecode engineering library.
See this answer for further information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With