What JavaDoc tags should I use in private fields and methods in order to generate javaDoc descriptions?
Yes you should write JavaDoc for private methods, and even when it is only for yourself. In 3 years when you have to change the code, you will be happy that you documented it. If you leave the company, or have to work on another project, your co-workers will be happy to have a documented code.
All public and protected methods should be fully defined with Javadoc. Exception may be when a method is a simple getter or setter where a description would not add any information though it does no harm to do so. Package and private methods do not have to be documented, but may benefit from it.
Javadoc is not required on a method that is tagged with the @Override annotation. However, under Java 5 it is not possible to mark a method required for an interface (this was corrected under Java 6). Hence, Checkstyle supports using the convention of using a single {@inheritDoc} tag instead of all the other tags.
Place the caret at the declaration in the editor, press Alt+Enter , and select Add Javadoc from the list.
See Java Javadoc include Private; you still use the standard JavaDoc comment form but you must instruct the JavaDoc tool to generate the documentation for private members using the -private
switch.
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