Introspection allows a Java class to find out all sorts of neat information
about other Java classes. Here's the source code for a "class dumper;"
you give it the name of a class, and it dumps out a bunch of info about
the class to stdout. I've written it so that all the information generated
is appended to one long string. Once JDK 1.1 is more widely supported in
browsers, I'll probably hack up an applet version of this.
This utility is helpful to have because it displays all the
methods available from a given class, including those implemented in
ancestors. I've spent enough time hunting my way up the class hierarchy
from, say, Frame to Window to Container to Component to Object that I
appreciate being able to find out at a single step where to look for more
information.
Anyway, here's
the source.