Adam Bien's Weblog
NetBeans Got An Excellent toString Generator
NetBeans 6.8 doesn't come with a toString generator out of the box. The toString generator solved the problem very well. The generator is available from the alt+insert (ctrl+i) pop-up - and so very convenient to use. You can choose between String and StringBuilder based generation. It works as expected:
One problem - I didn't found any reference to a NBM file and had to build it manually. It is very easy, but it takes few minutes and is inconvenient. I'm sure, that Simon is already working on a CI solution :-).public class ToStringTest { private String name; private int age; private Boolean flag; private String descripton; //was generated @Override public String toString() { return "ToStringTest [" + "age " + age + " " + "descripton " + descripton + " " + "flag " + flag + " " + "name " + name + "]"; } }
Posted at 10:27AM Sep 11, 2009 by Adam Bien in Netbeans | Kommentare[3]
[my tweets]
Rss My book: Real World Java EE - Rethinking Best Practices


Hi Adam,
Nice to see that it does what you expect. We are still working on some features and will have an ever better version soon.
The download of the toString() generator can be found in NetBeans Plugin Portal:
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=21008
Kind Regard,
Simon
Gesendet von Martinelli Simon am September 11, 2009 at 01:28 PM CEST #
And now there is also a download section on kenai project ;-)
http://kenai.com/projects/nbtostring/downloads
Gesendet von Simon Martinelli am September 11, 2009 at 01:32 PM CEST #
@Simon,
some pressure seems to help :-). I looked at the code - its nicely done, although the parsing API is bit complex.
have fun!,
adam
Gesendet von Adam Bien am September 11, 2009 at 05:44 PM CEST #