Re: [Simple-support] Multiple Elements with same name, different Attributes
Brought to you by:
niallg
|
From: Boris G. <bo...@gl...> - 2014-03-26 14:14:46
|
Hi Niall Thank you for your really, so would i need converter on userInfo or on address? Also is there a good sample for this, i am kind of new to Java. UserInfo contains much more info witch get deserialized just fine, it just address i need to get Address in to the right variable depending on Attribute. Thank you. Boris On 3/26/2014 12:59 AM, Niall Gallagher - Yieldbroker wrote: > > Hi, > > You would have to write a Converter for this. This requires you implement > > http://simple.sourceforge.net/download/stream/doc/javadoc/org/simpleframework/xml/convert/Converter.html > > Niall > > *From:*Boris Gligich [mailto:bo...@gl...] > *Sent:* 26 March 2014 14:31 > *To:* sim...@li... > *Subject:* [Simple-support] Multiple Elements with same name, > different Attributes > > Hi All, thank you for support and great product. > > > I have following XML > > <userInfo> > <address type="home"> > <a>123 Home Way</a> > </address> > <address type="office"> > <a>212 city street</a> > </address> > </userInfo> > > > and this Class: > > public class userInfo{ > String home; > String office; > } > > > And i have no idea how to accomplish this, as @path doesn't support attribute filtering, please help. > > Also order of address is not guaranteed, it could be in any order... > > Thank you. > > -- > Boris |