Javadoc'ing use of annotations ...

If you are like me, you like using javadoc tool to generate source documentations for your Java projects. You need to choose between package.html and package-info.java both of which are not well accepted by today's Java IDE's IMO. For example, both NetBeans and Intellij IDEA treat package-info.java with a grump. But anyway, today's tip is about how to make javadoc behave when you want to document the use of your annotations.

It was a disappointment (like, D'oh, c'mon, Javadoc!) when javadoc refused to treat @Option (Option was an annotation type I was documenting) as an annotation even in a <pre> section of package.html . Instead, it kept on treating a Javadoc tag!

Finally, lightning struck and I used the HTML character entity for '@', which is ASCII 64 and hence "@". Thus, the use of annotation should be:

  & # 64 ; Option (....)  
  volatile private String x;
Of course, you should remove the spaces between '&', '#', '64' and ';' to get the '@'. It's non-intuitive, but it works! Do you have any better suggestion?
Comments:

llllllllll

Posted by guest on October 29, 2010 at 01:14 AM PDT #

llllllllll

Posted by llllllllll on October 29, 2010 at 01:14 AM PDT #

Post a Comment:
Comments are closed for this entry.
About

Welcome to my blog where mostly my work related thoughts are expressed.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today