Total Pageviews

2011/09/07

How to Automatically Add Javadoc and File Headers to Your Source Code

Problem
In our project, we need to fix all checkstyle checking errors. One of the most annoying error is missing a Javadoc comment.





Solution
We can install an Eclipse Plugin, JAutodoc, to help us.
JAutodoc is an Eclipse Plugin for automatically adding Javadoc and file headers to your source code. It optionally generates initial comments from element name by using Velocity templates for Javadoc and file headers.
Official site: http://jautodoc.sourceforge.net/index.html


Where to download?





How to Install?
1. Before you install, please shutdown your eclipse
2. copy two jar files to plugins folder
3. copy one feature folder to features folder

4. Restart Eclipse


How to Use?
Select a single or multiple class(es): right click --> JAutodoc --> Add Javadoc


 JAutodoc will generate comments from element name as shown below
 
 JAutodoc will generate comments from method name as shown below






1 comment:

小池 said...

好想點個讚... :D