Canonical ordering of javadoc comments

R

Roedy Green

Are you aware of any accepted conventions on the precise ordering of
Javadoc comments?

What do you use yourself?
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal."
~ George Gaylord Simpson
 
L

Lew

Roedy said:
Are you aware of any accepted conventions on the precise ordering of
Javadoc comments?

What do you use yourself?

A doc comment is composed of a main description followed by a tag section ....
First sentence - The first sentence of each doc comment should be a summary
sentence, containing a concise but complete description of the declared
entity.

A doc comment ... is made up of two parts --
a description followed by block tags.

Normally method comments have the block tags in the order @param tags,
@return, @throws, @version, @see, @since, @deprecated.
<http://java.sun.com/j2se/javadoc/writingdoccomments/index.html#orderoftags>

It's safest to follow Sun's conventions, which have been well established
since about 2000, judging by the copyright date.
 
R

Roedy Green

Normally method comments have the block tags in the order @param tags,
@return, @throws, @version, @see, @since, @deprecated.
<http://java.sun.com/j2se/javadoc/writingdoccomments/index.html#orderoftags>

This turned out to be a bit more complicated than that paragraph at
Sun would suggest.

I have posted an essay on my findings at
http://mindprod.com/jgloss/javadoc.html

I have also converted by body of source to the official standard with
a little program I wrote. Source for the converter is posted at.

https://wush.net/websvn/mindprod/fi...th=/com/mindprod/repair/TidyLeadComments.java

You would have to tweak it to find the patterns in on your own code,
and precise details of your new desired format.

I have not yet committed the complete body of converted code. I am
doing a few other things to try to stop pointless deltas.



--
Roedy Green Canadian Mind Products
http://mindprod.com

"Species evolve exactly as if they were adapting as best they could to a changing world, and not at all as if they were moving toward a set goal."
~ George Gaylord Simpson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Lazy Javadoc question 4
Lazy Javadoc question 1
Canonical Comments 57
"final" bug?? 8
Tidying Javadoc 0
File level asserts. 5
pruning a Zip 12
final and constructor, a Java Wart 14

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top