O'Reilly logo

GWT in Action, Second Edition by Adam Tacy, Robert Hanson, Jason Essington, and Anne Tökke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

18.7. Creating your own generator

It’s much simpler to write your own generator than you might imagine. We find the hardest part is the amount of code you have to write and dealing with the strings when writing your new class.

Typically, you write a generator taking the stepwise approach shown in figure 18.7. Every generator follows the same pattern: extending the Generator interface and implementing the generate method. So it makes sense that we look at that first. Then you’ll need to create a new output type (usually a new class) and start writing content into it. That content will most likely be based on other artifacts of the compilation (resources, types, properties, and so on) that you can access through one of three GWT-provided oracles. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required