Request Factory - Getter issues

37 views
Skip to first unread message

Antoine DESSAIGNE

unread,
Oct 26, 2011, 11:13:52 AM10/26/11
to GWT
Hi,

I have 2 issues with the RequestFactory 2.4.0:
- It doesn't seems to support array types as return types, "Request<FooProxy[]> getAllFoo()" doesn't work
- My Foo base type and thus my FooProxy types have getters without the 'get' prefix, it's "name()" instead of "getName()". This throws an error at compilation: "[ERROR] The method public abstract java.lang.String name() is neither a getter nor a setter"

Is is possible to make it work or should I convert all my arrays into lists and add the 'get' prefix on all my getters?

Thanks a lot,

Antoine.

Antoine DESSAIGNE

unread,
Oct 28, 2011, 3:17:57 AM10/28/11
to GWT
No one?

2011/10/26 Antoine DESSAIGNE <antoine....@gmail.com>

Thomas Broyer

unread,
Oct 28, 2011, 4:15:11 AM10/28/11
to google-we...@googlegroups.com
No, RF doesn't support arrays (the reason being that you cannot make a "proxy" for an array, to make it immutable); and it requires "get", "is" or "has" prefixes on getters (and "set" on setters); this is the Java Bean convention (with the addition of the "has" prefix).
You could possibly make it work using a ServiceLayerDecorator and a hand-coded DeobfuscatorBuilder (i.e. do not run the ValidationTool, at least not for its role of generating a DeobfuscatorBuilder) on the server-side, and annotating the proxies with @SkipInterfaceValidation to make the GWT Compiler happy. Just a guess though.

Antoine DESSAIGNE

unread,
Oct 28, 2011, 4:30:58 AM10/28/11
to google-we...@googlegroups.com
Thanks a lot !

I will update my code.

2011/10/28 Thomas Broyer <t.br...@gmail.com>
No, RF doesn't support arrays (the reason being that you cannot make a "proxy" for an array, to make it immutable); and it requires "get", "is" or "has" prefixes on getters (and "set" on setters); this is the Java Bean convention (with the addition of the "has" prefix).
You could possibly make it work using a ServiceLayerDecorator and a hand-coded DeobfuscatorBuilder (i.e. do not run the ValidationTool, at least not for its role of generating a DeobfuscatorBuilder) on the server-side, and annotating the proxies with @SkipInterfaceValidation to make the GWT Compiler happy. Just a guess though.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/QxxGpN6Q8_oJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Reply all
Reply to author
Forward
0 new messages