Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Groovydoc: Documenting named parameters

Tags:

groovy

I've created a method like so:

void myMethod(Map kwArgs, def myParam)
{
   println kwArgs.firstName
   println [kwArgs.lastName, "Wilcox"].find()  
   // ^^^ if lastName named parameter not specified, "Wilcox"

   ....
}

Now comes the time to document this method with GroovyDoc. Part of it is easy

/**
  myMethod rules the world
  @param myParam something something

But how do I document the named parameters? (Likewise, how can I specify that the lastName parameter has a default? (ie is there some metadata I can set or just make that explicit to the reader in the English description?)

like image 597
RyanWilcox Avatar asked Nov 08 '22 18:11

RyanWilcox


1 Answers

But how do I document the named parameters?

Unless you are considering writing a customer doclet or similar, I think you will just document them as text in the comment.

like image 196
Jeff Scott Brown Avatar answered Nov 15 '22 06:11

Jeff Scott Brown