Chapter 18. Generators
This chapter covers
Wouldn’t it be nice if your toolkit could write your code for you? Imagine, you provide a few instructions and, voila, your code is produced. Although you can’t (yet) do this for a whole application, GWT gets close to this idea in a number of areas.
If you’ve used RPC, internationalization, JUnit, UiBinder, client bundles, or even dependency injection (as we described a couple of chapters ago) in your GWT application, you’ve experienced this, maybe without realizing it.
For example, with internationalization you write an interface and one or more properties files whose name(s) follow a specific naming convention. At compile time, GWT will automatically generate a set of classes that implements the interface, each class containing methods that return values from the properties file for a specific locale. These generated classes are then used in the compilation of your application, giving you a multilingual application.