|
|
|||||||||||||||||||||||||||||||||||||||||||||
Tim Boudreau's Blog
What technology evangelists really do for a livingPosted by timboudreau on April 11, 2008 at 08:21 AM | Permalink | Comments (1)We shot some video on our recent whirlwind tour of South America. This fun video shows one of our adventures. What do technology evangelists really do for a living? Ride in taxis and buses, of course! BTW, the video editing and post-production was done by my good friend and music buddy Doug Finn (douglas dot finn at gmail). He is a supremely talented video editor, actor, director and musician. If you're looking for something like this, I highly recommend him. A couple of other videos from this trip (less slickly edited, since it was me doing them not Doug) are visible at the bottom of this page on netbeans.tv. The person I really feel for in the above video is Juan Daniel Perez, whose reward for helping organize our event in Cordoba was that five guys piled into his hotel room at 6:30 in the morning to use his shower :-) See Java code the way javac sees itPosted by timboudreau on February 28, 2008 at 03:50 PM | Permalink | Comments (23)I wrote a small Swing app to browse javac's abstract syntax trees (ASTs) of source code. If you've ever wanted to write a tool that analyzes Java source code, it is a big help for understanding the Javac tree API. Last spring I set about learning javac's Tree API (JSR 199) - NetBeans uses it internally as its parser for Java source code. It has a bit of a learning curve, and contains lots of this-tree and that-tree interfaces for different types of structures in Java source code. So to help me develop an intuitive understanding of what all of these classes map to, I wrote a tool - a standalone Swing app that lets you open a Java source file and then browse its AST.
The tree on the left lets you drill through the syntax tree itself. The middle pane shows you the object that is selected, and a tree of all of its fields and methods via introspection, which you can drill as deeply as you want through. The right pane is sensitive to selection in whichever of the other two panes has focus. The top half shows you the list of all types the selected object implements (and boldfaces those that are part of the official API), and the bottom half shows you the value of toString() for the selected object (if it's part of the syntax tree, it will be the source code text).
I found it very useful, and still use it to figure out just how to hunt down a particular thing I want to find in source code. Hopefully it will inspire some others to play with javac as well. It requires JDK 6. You can download the JAR file here and just run it with java -jar.
contrib/SyntaxTreeNavigator (everything was reorganized for the recent migration to Mercurial, and I haven't figured out where it is in the new source structure yet).
I have updated the JAR file to produce better diagnostic information, and added a source zip file.
Class visualization module for NetBeansPosted by timboudreau on February 28, 2008 at 02:13 PM | Permalink | Comments (0)Last week I wrote a little module that uses the NetBeans Visual Library and the Javac Tree API to create a graph of the contents of a Java file, showing dependencies between class members. It's now available on the NetBeans daily build update center - if you're running a daily build of NetBeans, just go to Tools | Plugins and download Graphical Class Viewer. My question is, would anybody actually find this useful? It was mostly an experiment to get more fluent with a couple of APIs I need to know well - but it seems like it could be handy if you're going to edit a class you didn't write and want to see where the action is - or if you've got a bunch of encapsulated fields and want to quickly see if anything is not using the getters and setters. What it does:
Feel free to try it out and let me know if you think it's something worth putting more work into. Also, if anyone knows of any speedy and good hub-and-spoke or other layout algorithms for the case where you have n nodes each of which can have up to n-1 connections to other nodes, feel free to let me know - what it does now is less than optimal. At some point I may think through the geometry to do it nicely, but I'm not sure when. The sources are in NetBeans contrib mercurial repository. Comments? Reply on the NetBeans DZone thread about it. |
May 2008
Search this blog:CategoriesBusinessCommunity Community: Java Enterprise Community: Java Patterns Community: Java Tools Community: JavaDesktop Community: NetBeans J2EE J2ME J2SE Jini Open Source Programming Swing Tools Web Applications Archives
April 2008 Recent EntriesWhat technology evangelists really do for a living See Java code the way javac sees it Class visualization module for NetBeans | ||||||||||||||||||||||||||||||||||||||||||||
|
|