Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javadoc - how to copy function description?

Tags:

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?

like image 544
GetUsername Avatar asked Mar 30 '11 09:03

GetUsername


People also ask

How do you write a description in Javadoc?

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.

How do you comment a function in Java?

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 "*".

How do you reference a Javadoc code?

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.

What is a summary Javadoc?

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.


1 Answers

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

like image 144
Kevin D Avatar answered Oct 03 '22 04:10

Kevin D