I have used following convention for my generator:
A separate GWT Module under com.my.company.generator
com.my.company.generator
|-> MyDataGenerator.gwt.xml
|-> com.my.company.generator.client
|-> MyDataInterface.java
|-> com.my.company.generator.rebind
|-> MyDataGenerator.java
MyDataGenerator.gwt.xml contains client code and genrator rules:
<source path="client"/>
<generate-with
class="com.my.company.generator.rebind.MyDataGenerator">
<when-type-assignable
class="com.my.company.generator.client.MyDataInterface"/>
</generate-with>
MyDataInterface.java is a marker interface to use and contains markup
annotations for my generator.
MyDataGenerator.java extends Generator and generates java based on my
supplied annotations.
In my main project; I inherit this Generator module:
<!-- Custom Generators -->
<inherits name="com.my.company.generator.MyDataGenerator" />
And use as:
MyDataInterface InstData = GWT.create(MyDataConfig01.class);
MyDataConfig01 extends MyDataInterface {
//Makes use of annotations to markup configurations
}
Regards,
Nirmal
On Nov 12, 8:28 pm, Thomas Broyer <[email protected]> wrote:
> On 12 nov, 08:27, hezjing <[email protected]> wrote:
>
> > Hi
>
> > Where should the custom generator reside in? client package or rebind
> > package?
>
> > Inhttp://francisshanahan.com/index.php/2010/a-simple-gwt-generator-exam...,
> > it explained that it should reside in server package.
> > However
> > inhttp://timepedia.blogspot.com/2007/06/gwt-demystified-generators-part...,
> > it is in rebind package.
>
> > Which is the recommended package to keep our custom generator?
>
> GWT itself uses "rebind", but it's really just a convention.
>
> The point is that it must not live in "the client or shared" code (as
> Francis Hanahan writes)
> (and again, "client" and "shared" are actually only conventions)
>
> > Also, I'm curious why there is no Google's GWT documentation or tutorial
> > about the generator?
>
> I think it's because it's an "advanced" topic, and developers should
> be curious enough to look into GWT's own code to find how things are
> done (I18N, UiBinder, ClientBundle, etc.). And IIRC the JavaDoc is
> good on this subject.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.