Translate

Saturday, April 21, 2007

Javadocs, deep linking and quick reference

My Class Viewer project gives two key things with javadocs:

1. A handy way to keep up with all of them using an xml file, which I call packagedirectory.xml, where you can put in public javadocs as well as your own, and then, you can just forget about worrying where they are!

(Note the xml file can be edited easily in a text editor.)

2. Deep linking into javadocs to the method, where if you don't know the exact method you can do searches using a single char or as much of a string as you want with any piece you might think is in the method as I made the search as flexible as I could.

Understanding deep linking is just about seeing it done once, and you can see an example in my previous post, but the gist of it is that you get taken to your method in the javadocs, so no more scrolling down searching!

But these features have been available from my project for over three years now.

Ok, yeah, there was a long period with a minor bug where when a method had multiple arguments the URL would have an extra space in it, so you'd get taken to the top of the javadocs page---which is a gracious failure---but I finally fixed the code.

The problem still remains though with Microsoft's Internet Explorer, last time I checked, which is yet another good reason to get Firefox!

Oh and did I mention that once you put your javadocs location in packagedirectory.xml you need never worry about where your javadocs are again? Yes I did, but that is such a huge feature, and there are other solutions out there like javadoc online but there you do not get deep linking and what about your own projects and your own javadocs?

Why not let the computer keep up with all that detail, which you can do with Class Viewer?


James Harris

Saturday, April 14, 2007

Gateway to javadocs

I have been wondering if there might be a market for a custom Class Viewer for a software development company where Class Viewer is used as a gateway for that company's javadocs.

So, when first opened instead of the "No Warranty" message on the left and a blank window on the right it might have the primary packages for that company's code on the left and possibly news on the right.

To me it has always been a middleware app which bridges the gap from Sun Microsystem's excellent javadocs format to casual searching and quick reference.

And that was on purpose as when I was working as a Java developer for a major corporation, I would at times find myself wandering around through javadocs trying to get answers to highly specific questions, like, I'd be looking for a method in the String class that I knew took chars but I couldn't quite remember the name, which is why I use that as an example for my Class Viewer screenshot.

Covering all the bases Class Viewer returns ALL public methods that have the character string "char" in them:

char charAt(int)
boolean contains(CharSequence)
boolean contentEquals(CharSequence)
static String copyValueOf(char[],int,int)
static String copyValueOf(char[])
void getChars(int,int,char[],int)
String replace(CharSequence,CharSequence)
String replace(char,char)
CharSequence subSequence(int,int)
char[] toCharArray()
static String valueOf(char[])
static String valueOf(char)
static String valueOf(char[],int,int)


And, of course, that's not hard to do, but what else let's you do it?

I've actually been tempted to try and contact Sun Microsystems to see if they wouldn't put some custom Class Viewer up on their site versus only directly giving you javadocs when you go to the reference links, as I spent enough time years back wandering around on their site trying to find things, while now if, say, you want to know how to replace one char with another, you can search out "char" on Class Viewer like above, and just double-click on String replace(char,char) and Class Viewer will deep link you into the javadocs wherever you tell it, and right now mine gives me:

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#replace(char,%20char)


And the ability to be taken directly to the method in javadocs is just a neat feature that is part of the Sun Microsystem underlying design, which should be exploited, as once you get used to it, it feels so tedious to scroll down looking for a method, and also like such a waste since the machinery is there for a more efficient process.

In any event, just kicking some ideas around, and I've just not felt confident enough about success to actually approach anyone, and like, what would I charge for custom work? But hey, it's open source so if that's a good idea, it's not like some other programmer couldn't do it, or companies just do it themselves.


James Harris