Javadoc with embedded source code

Hi all,

Is there a way that I can embed the source of each function in the javadoc html pages. Function descriptions in that case may have a small + sign next to them, clicking on which displays the source for that function.

This functionality will be really useful as many a times reading the actual code is better than reading the documentation to know what exactly the function does. Further, with many open-source projects (e.g., apache jakarta) around it will be even better.

May be some AJAX can be used. I have seen javaref.com but that is quite an overkill with too much of AJAX.

[612 byte] By [nileshbansala] at [2007-11-27 3:10:18]
# 1
javadoc -linksource http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#linksource
dhkramera at 2007-7-12 3:59:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2
hmm... but -linksource actually sucks. Firstly, it does not even highlight the source. Then it can probably do much better by linking items in the source to their Javadoc things. Anyone aware of something better?thanksNilesh
nileshbansala at 2007-7-12 3:59:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3
Well, I'd ask, what's the point of putting code in javadoc in the first place? Why not just read the source code? In addition, there's the risk of the javadoc & the source getting out of sync.
Dick_Adamsa at 2007-7-12 3:59:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 4

Well ..

its not practical to link the source code with javadoc as there is a high probability of actual source code and the code present in javadoc will get Out of sync.

Also if a developer is interested in the code he can check it anytime from the repository

P.S: It is called JAVADOC and not JAVACODE !!!!!!!!!!!!!

Cheers!!

vinayak_ra at 2007-7-12 3:59:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...