At some point during the serialization process GWT is calling getClass() on 
your method return value which always resolves to the runtime class. Thats 
just how getClass() in Java works. I don't think you can change that 
behavior of GWT-RPC.
If I give you an instance of type Object how would you know that you only 
have to serialize a specific super class of the runtime type of that 
instance? Thats probably only possible by searching for specific 
annotations that contain that information. GWT-RPC does not have such 
annotations.

A somewhat similar question 
is: https://groups.google.com/d/msg/google-web-toolkit/OxuDRkJGFDE/jQd_V0aYzaYJ

You can probably do the same here. Make Subtype a shared class with a 
super-source version for GWT. The super-source version would be empty and 
just extend Type. The CustomFieldSerializer for Subtype would now only 
read/write the Type variables during de-/serialization.

-- J.


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to