1

Projects like hadoop have a ton of parameters, but all that documentation is manually generated from xml, rather than coming from the code.

Is there a way of doing something with an annotation that can generate this documentation?

  public static final String MAP_SORT_SPILL_PERCENT = "mapreduce.map.sort.spill.percent";

  <name>mapreduce.map.sort.spill.percent</name>
  <value>0.80</value>
  <description>The soft limit in the serialization buffer. Once reached, a
  thread will begin to spill the contents to disk in the background. Note that
  collection will not block if this threshold is exceeded while a spill is
  already in progress, so spills may be larger than this threshold when it is
  set to less than .5</description>
Alun
  • 541
  • 6
  • 16

1 Answers1

0

You can use @param javadoc tag to generate parameter information in the code, such as this example from the wikipedia page:

/**
 * Short one line description.                           
 *
 * @param  variable Description text text text.         
 * @return Description text text text.
 */    
public int methodName (...) {
    // method body with a return statement
}

That's how Oracle generates the official doc for Java (example)

Andy Guibert
  • 41,446
  • 8
  • 38
  • 61
  • That's a parameter to a function, this is an external parameter to a program. – Alun Jul 21 '15 at 20:28
  • same rules apply, right? You can still put javadoc on your main() method using the @param annotation. If that's not what you're looking for, can you clarify the question more? – Andy Guibert Jul 21 '15 at 21:25