| java reflection experiments
So there I was, sitting on a train bound home, and feeling creative. I powered up my laptop, switched to Emacs and began hacking away - just to realize that I have no documentation on available on the computer. At all. (Two years ago, I would've used my fancy bluetooth phone and surfed to the nearest Javadoc site using GPRS, but I tend to lose all my cool gadgets so no more mobile Internet for me.)
What to do, when you feel like being productive but still lack the oh-so-vital API reference? I don't know all the methods of the javax.imageio by heart. I don't remember all methods in the classes of package javax.servlet.http, even though I've hammered them over and over hundreds of times.
For some reason though, I still remember some basics of the Reflection API. One reason being, of course, that the basic reflection API is very inituitive and straight-forward. There's the basic Class.forName(), and Class' getMethods() and getFields(), Method's getReturnType(), and so on. So I figured I could write a simple JSP to list the methods and fields of the classes I wanted to use. So that I did. Eventually, I reflected the Reflection API to see how I could retreive information about the classes and interfaces. Later on, I even used reflection to dynamically find and invoke the reflection getters to be able to retreive static values of static class fields.
Of course, I ended up spending the entire train trip doing pointless wheel-invention - a sort of a poor man's reflective Javadoc without the actual documentation - instead of actual billable work. But hey, it was a fun trip to reflection land, and yet another bulky (and buggy!) JSP-hack to add to the list. I never quite finished it, and some things I just couldn't figure out without access to the API documentation (such as how to properly interpret the modifier bits). And now, with access to all the documentation I can handle, the thrill just isn't there anymore. :-)
Anyway, see the result here (view source).
|
|
| << May >> |
| Mon
| Tue
| Wed
| Thu
| Fri
| Sat
| Sun
|
| |
|
|
|
|
|
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 |
31 |
|
|
|
|
|
|
Hi. Have fun. Eat chocolate.
Rasmus/nätdagbok
Photoblog
Linkblog
archive
September 2009 (1) April 2008 (2) November 2007 (1) October 2007 (1) July 2007 (1) May 2007 (1) March 2007 (3) December 2006 (2) March 2006 (1) December 2005 (1) June 2005 (1) May 2005 (1) February 2005 (6) January 2005 (2) December 2004 (14) November 2004 (7) October 2004 (3) September 2004 (2) June 2004 (1) April 2004 (2) March 2004 (14) October 2003 (2) September 2003 (2) August 2003 (5) July 2003 (7) June 2003 (24) March 2003 (3) February 2003 (22)

contact me
rasmus@dll.nu
projects
Duper
Webhammer
Fiddler GZip
LatteKOM
Nular Shell
Weblatte
MD5i
XSS
Svenska låttexter
business
Bricole
MrFriday
PayPerGigabyte
friends and foes
Himmelmora mo
Jonas is Vildsint
Lenore: The Cute Little Dead Girl
Mico (Micoi!)
Månhus beta
Petnoga
Santeri (with metacomic!)
Skatteverket
Staffan (lagen.nu)
USD/SEK exchange rate
Wobbler [eye/ear-candy]
random
home sweet home,
skitbil, yada-yada,
muffin, PGP key,
not pong, old mobphotos,
fest,
boja, antifloppy,
vitlök, style-fu,
old^2 blog, grog,
18 seconds..., old mobvideos,
quickbasic irc client (source),
sommar, wico,
Arbitrary proxy,
mera grogg!,
The Landmark Family Genealogy Project ...
|