Re: [Simple-support] Providing Extra Type Information to the Serialization Engine
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-05-14 07:32:12
|
This is a limitation of Java. In c# and other typed languages T would be available, however Java generics are not reified, so this type information is erased at compile time. It is impossible to know what T is at runtime I am afraid.
--- On Fri, 13/5/11, Azubuko Obele <buk...@gm...> wrote:
From: Azubuko Obele <buk...@gm...>
Subject: Re: [Simple-support] Providing Extra Type Information to the Serialization Engine
To: "Niall Gallagher" <gal...@ya...>
Cc: sim...@li...
Received: Friday, 13 May, 2011, 9:16 PM
Hey Niall,
UnionList looks cool but I'm not sure how it helps me. The problem is I have a base class with a generic collection (see below). Subclasses
specialize this generic parameter but SimpleXml complains that it doesn't know the type of the inherited collection being de/serialized.
--- On Fri, 13/5/11, Azubuko Obele <buk...@gm...> wrote:
From: Azubuko Obele <buk...@gm...>
Subject: [Simple-support] Providing Extra Type Information to the Serialization Engine
To: sim...@li...
Received: Friday, 13 May, 2011, 4:55 AM
Hello,
If I have a generic class like:
public class ItemList<T> {
@ElementList(inline = true, required = false)
private List<T> items = new ArrayList<T>();
}
And then I have subclasses of this like AList extends ItemList<A> and BList extends ItemList<B> ... Simple will fail to serialize such classes because it can't determine the type of the generic property. Is there perhaps a mechanism so that I might be able to provide this information to the engine somehow?
Thanks
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|