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 a message this way
def closure = {name,id ->
log.debug "Executing method with params name:${} id:${id}"
}
OR
void method (String name,String id) {
log.debug "Executing method with params name:${} id:${id}"
}
I read once about a way to reference the list of parameters of a closure, but i have no recollection of that and looking at the groovy API for Closure reveals only getParametersType() method. As for the method, there is a way to call a method as a closure and then i can retrieve the method parameters
ken