Re: [Simple-support] deserialize with attribute name="class"
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2008-09-07 15:10:28
|
Hi, This is not a bug. The "class" attribute is a reserved attribute. It specifies the name of the concrete class when polymorphism is required. You can use the CycleStrategy and rename the class attribute to something else like "type" if you like. In the next release I will be making this more configurable. Niall --- On Sat, 9/6/08, mic...@is... <mic...@is...> wrote: > From: mic...@is... <mic...@is...> > Subject: [Simple-support] deserialize with attribute name="class" > To: sim...@li... > Date: Saturday, September 6, 2008, 6:12 PM > Hi, > > I am trying to serialize/deserialize with Simple 1.7.2 > > when I use something like: > > @Attribute(name="class") > String name_of_class; > > then persisting into xml works. However when I try > to deserialize xml file then I get: > > Exception in thread "main" > java.lang.ClassNotFoundException: ... > > if I change to: > @Attribute(name="clazz") > String name_of_class; > > then it is possible to serialize/deserialize without any > problems > > It looks like a bug to me. > > Michal > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move > Developer's challenge > Build the coolest Linux based applications with Moblin SDK > & win great prizes > Grand prize is a trip for two to an Open Source event > anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support |