18.5. Pulling it all together

We can summarize the steps involved to use a generator as the following:

  1. You write a Java class, SomeGeneratorClass, that extends the Generator class of the com.google.gwt.core.ext package. By convention this class will be in a rebind package.
  2. In a module file, you provide a <generate-with> tag that defines when the generator should be applied: <generate-with class="com.gwtbook.rebind.SomeGeneratorClass"> <when-type-is class="com.gwtbook.client.SomeType"/></replace-with>
  3. You define SomeTypeToBeGenerated, which will extend or implement a trigger type (an interface or class—let’s call it SomeType).
  4. You see, or use, the following code in a GWT application, which implies that a form of deferred binding is going ...

Get GWT in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.