Thomas, this solution is better than mine... I'll try it! 2008/12/15 Thomas Broyer <[email protected]>
> > > On 14 déc, 19:31, "Magno Machado" <[email protected]> wrote: > > I have to write a generator whose marker interface has a generic typeMy > > marker interface will be like this: > > > > public interface MyInterface<T> { > > > > } > > > > the subinterfaces will provide a type for that parameter, like: > > public interface MySubInterface extends MyInterface<Customer> { > > > > } > > > > and then I will call: > > MySubInterface = GWT.create(MySubInterface.class); > > > > Inside the generator, how can I find out what type was used on T > parameter? > > (Customer, in this case) > > If I understood correctly (both your question and the GWT code), you > should be able to write: > > // where 'type' has been returned by the TypeOracle > JParameterizedType parameterizedType = type.isParameterized(); > JClassType T = parameterizedType.getTypeArgs()[0]; > // now you can check that T is Consumer or something else > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
