Geertjan's Blog

  • November 29, 2010

Safe References to Bundle Keys on the NetBeans Platform

Geertjan Wielenga
Product Manager
If you, as is normal, have this in your class, there's no way of knowing whether the key you are referring to actually exists:

Wouldn't it be much better if you could refer to a String in a Bundle class instead, i.e., instead of referring to a key in a Bundle.properties file?

Only if the String actually exists, will it be available in code completion. And if you make a typo, the file won't compile and a red error message is shown in the editor.

It's not very hard to set things up, as described in a very nice article by Edvin Syse, entitled NbBundle on Steroids Using Annotation Processors.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.