• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javadoc question (public methods in non-public classes)

 
Adrian Engler
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For all public methods, Javadoc has to be provided. However, as far as I know, the visibility level can only be specified for classes and methods together for Javadoc, so if the visibility level public is chosen, Javadoc will not be generated for public methods of non-public classes, which means that the requirement that there has to be Javadoc for all public methods is not met (in my project, the majority of classes is not public, but some of these non-public classes have public methods, e.g. because they implement an interface).

What is the best solution?

What I would prefer to do is to use the Javadoc parameter -package - not only because this makes sure that Javadoc is really generated for all public methods, whether they are in public classes or not, but also because the Javadoc for the public classes and methods alone looks too meagre. For something that is really a library intended to be used by people who do not have to care about the internals of a package, this may be a good thing, but I assume that in the case of the SCJD project, the Javadoc documentation should also give an overview of the structure of the project, and in the case of my project, it doesn't if only the relatively few public methods of public classes are mentioned (on the whole, I think it is a good things if the public interface of the packages is small, but then, the public interface is not enough for someone who is interested in how the packages are structured internally).
However, when I use the -package argument for javadoc, so that everything that is not private is taken into account, there is more than is required by the assignment - could this be a disadvantage?
 
Chris Be
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adrian,

Since the purpose of the javadoc would be in this exam instance for the assigment assessor to evaluate what you did, I don't think generating private javadoc could be of disadvantage. After all, you can mention your reasons in choices.txt.

I do:
Javadoc every single bit of code (type,method,field...) and package (package-info.java), down to private level.
Generate javadoc at private level.
State my reasons in choices.txt.

Cheers,

Chris
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic