I need a list of all methods and their arguments at run time from all controllers in any project. I have not find a way or an example of retrieving the arguments. For example in the method:
def login(String username, String password) {
...
}
I need the arguments username and password with their type.
Many thanks for your help.
During compilation, an AST transformation adds an empty method for action methods with arguments. This is annotated with the
grails.web.Action
annotation which has acommandObjects
attribute containing aClass[]
array of the classes of command objects and regular method argument types.So you can loop through all of the controllers in the application, and find all annotated methods: