Yesterday we updated the forum software so that it now supports creating links to the javadocs of many
Java libraries. That's what the "Javadoc" button is for that you see during writing a post or a reply. If you write [javadoc]java.lang.String[/javadoc], then it will automatically be replaced by a link to the appropriate page of the javadocs: java.lang.String. As a shortcut, it's possible to write [javadoc]String[/javadoc] for classes that are in the java.lang package - somewhat like what the javac compiler does. For all other classes the fully-qualified class name must be used.
This works for many Java projects and libraries: JSE, JEE, JME, JOGL, JMF, JavaHelp, Java3D, JAI, JavaFX, JavaSpeech, most Apache Commons libraries, XMLBeans, Axis 2, XML Crypto, log4j, Lucene, POI, JExcelApi, Struts 1 and 2, JFreeChart, JWebUnit, HttpUnit, HtmlUnit, JUnit 3 and 4, ImageJ, iText 2 and 5, XOM, JChart2D, OpenChart2, Stripes, Wicket, Spring, Seam, Tapestry, WebWork, Quartz, Hibernate 3, QuickTime for Java, Apple's Java extensions, Android, DOM4j, JDOM, Common DOM, MPXJ. If you find one missing that you want to refer to occasionally, just let us know about it, particularly where the javadocs are hosted.
(Update 3/28/09: WSS4J, JAX-RS, Jersey, Tomcat/Jasper 5.5/6 have been added.)
(Update 12/31/09: JEE 6, OSGi 4.2, LWUIT, javax.comm have been added.)
(Update 3/24/2011: Apache Shiro, JNLP, Tomcat 7 have been added.)
For JSE and JEE it's even possible to refer to different versions of the API. Just append a colon and the API version to the class name: [javadoc]String:1.3[/javadoc] turns into java.lang.String while [javadoc]String:6[/javadoc] turns into java.lang.String
That is very cool indeed. The geek in me however is already wondering about the technical gizmo behind the implementation. Perhaps there is a database table of these known classes and it is looked up when a post is published ? Or a cached map that maintains the association in memory. How would it handle a class it does not find, say class BlahBlooBlee. How does it handle class collisions ? Hmm... I ll try that out me thinks
Another cool feature is that if you highlight the class name and click 'javadoc' the pop up window does not appear and the tag is inserted automatically.
Sorry about the technical questions and test cases. Just curious
As a shortcut, it's possible to write java.lang.String for classes that are in the java.lang package - somewhat like what the javac compiler does. For all other classes the fully-qualified class name must be used.
I made sense of that now after seeing my published post. Cool feature
Except that the two are distinctly different. Ulf's uses an explicit javadoc tag, then matches the start of the package to a javadoc API and provides a link to the class in that API.
The function I am working on detects unlinked Java SE and Java EE classes and adds a link to the default API, and all classes are detected by both the class name and fully qualified class name.
and yes, there is a reason why the functionality is provided via two mechanisms ;)