Retrieve Groovy Closure/Method parameters list

后端 未结 3 665
孤城傲影
孤城傲影 2020-12-31 19:19

How do we retrieve the list of parameters of a closure/method in groovy dynamically, javascript style through the arguments array

say for example that i want to log

3条回答
  •  没有蜡笔的小新
    2020-12-31 19:34

    The parameter names can be retrieved if the compiler included debugging symbols, though not through the standard Java Reflection API.

    See this post for an example https://stackoverflow.com/a/2729907/395921

提交回复
热议问题