I have two Java functions:
/** * Do something with param */ public String doSomething(String param) {...}; /** * ... */ public String doSomething(Integer param) {...};
How can I make the second function's description to show an exact copy of the first function?
Writing Javadoc Comments In general, Javadoc comments are any multi-line comments (" /** ... */ ") that are placed before class, field, or method declarations. They must begin with a slash and two stars, and they can include special tags to describe characteristics like method parameters or return values.
By convention, in Java, documentation comments are set inside the comment delimiters /** ... */ with one comment per class, interface, or member. The comment should appear right before the declaration of the class, interface or member and each line of the comment should begin with a "*".
Javadoc provides the @link inline tag for referencing the members in the Java classes. We can think of the @link tag as similar to the anchor tag in HTML, which is used to link one page to another via hyperlinks. Similar to the anchor tag, the path_to_member is the destination, and the label is the display text.
Each Javadoc block begins with a brief summary fragment. This fragment is very important: it is the only part of the text that appears in certain contexts such as class and method indexes. This is a fragment—a noun phrase or verb phrase, not a complete sentence.
Assuming copy and paste won't work for you, I believe the convention is to use the @see tag to refer to another method which will give greater detail.
In your example the doSomething(Integer param) would have an @see tag referring to the String version.
Wikipedia has some examples, http://en.wikipedia.org/wiki/Javadoc
As does the oracle site for the javadoc tool http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#multiple@see
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With