Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java doc for private members

 
pramod karnani
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Do we need to generate the java docs for private members also ?

or to generate the java docs for public members is enough ?



Regards,
Pramod
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the javadoc default (protected) is enough. If you are to use protected then your doc comments should not have links to private members or classes. Because you will get error/warnings when generating javadoc.
 
Sigrid Kajdan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

it's perhaps a little paranoid to ask this, but... when you say you don't generate javadoc for private members, does it mean you just don't GENERATE it or don't you write any

(I have many private methods and would be glad to spare myself some work here...)

Thanks in advance
Sigrid
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh document everything private public you name it - everything. But the javadoc tool, protected is enough.

If you don't document private stuff, you may lose points for documentation. And no one wants that.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About the documentation i can read the following statement in my assignment:

javadoc style comments must be used for each element of the public interface of each class. You must create a full suite of documentation for the classes of the completed project. This must be generated using the tool "javadoc" and must be in HTML format. Provide javadoc documentation for all classes you write.


So just for the public methods will do i guess. I havae javadoc for each data member and method, regardless of the visibility (private, default, protected, public).

Kind regards,
Roel
 
Sigrid Kajdan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

thanks for your answers! In fact, after reading the instruction, I also was quite sure that writing javadoc for the public methods was enough... - just like you say, Roel.
But when I read that quite a few people think otherwise, and document the private methods anyway, I wonder whether it would be more safe to do this, too.

Perhaps it's not a must, but like you say K., it counts for the documentation? I guess I'll just do it too, then.

Cheers
Sigrid
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic