Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Develop Aspect-Oriented Java Applications with Eclipse and AJDT

By Matt Chapman, Dr. Helen Hawkins
2005-05-16


Generating documentation

You can use the javadoc tool to generate API documentation for Java projects, based on specially formatted comments in the source code. The AspectJ distribution, as of version 1.2, includes a tool called ajdoc. This is an extension to javadoc that adds details of the crosscutting nature of your aspects to the documentation generated by javadoc. The JDT tools in Eclipse include a wizard for invoking and configuring the javadoc tool, and with AJDT installed, a similar wizard is available for ajdoc.

To invoke the ajdoc wizard, select the Project>Generate ajdoc... menu option. In the dialog that appears, simply select the project for which you wish to generate the API documentation. In our case, this is the Spacewar example, as shown in Figure 15.

Figure 15. The ajdoc wizard
The ajdoc wizard

Many of the classes and methods in the Spacewar code are not public, so to make the generated documentation more useful, select the Private option in the visibility section of the dialog. The Destination field towards the bottom of the dialog specifies the output location, which defaults to a doc directory in the project.

Now click the Next button to go to the following page, which allows any additional options to be specified. Select the Open generated index file in browser option, so you can view the generated documentation as soon as it has been generated. After clicking Finish, you will be asked if you want to update the javadoc location -- if you say yes here, it simply remembers the output location for next time. The ajdoc tool is then launched, and you can switch to the Console view in Eclipse if you want to watch it running. Once it has finished, the index page should be shown in a Web browser. If you navigate to the spacewar.Registry aspect, you'll see that the regular javadoc output has been enhanced to show where the advice takes effect, as illustrated in Figure 16.

Figure 16. Generated documentation
Generated documentation



Tutorial Pages:
» Updated tools make AOP easier for beginners and veterans alike
» Installing AJDT
» First steps
» The Outline view and editor markers
» The Spacewar example
» Build configurations
» Aspect Visualization perspective
» Debugging
» Generating documentation
» Further options
» Conclusion
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Java Validation With Dynamic Proxies

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources