Re: [Simple-support] Deserialization of type Calendar?
Brought to you by:
niallg
|
From: <Nia...@ub...> - 2008-10-01 14:56:55
|
Hi, Well, you could change the PackageMatcher so that if it's a Calendar then it converts to a GregorianCalendar (but this means that if the field is Calendar then it will always be a GregorianCalendar). The reason this does not work with class= is because non-annotated types go straight to the Transformer. This relates to another similar issue reported where you can't mix primitives and annotated types in a single collection. Niall -----Original Message----- From: Timo Rumland [mailto:cr...@ol...] Sent: 01 October 2008 15:52 To: sim...@li... Cc: Gallagher, Niall-N Subject: Re: [Simple-support] Deserialization of type Calendar? Hello Niall, thanks for your quick reply. > If you change Calendar field to a GregorianCalendar field then it > should work fine. Currently it only supports this type of calendar. > I intend to expand this support the the other Calendar types soon > enough. I see that there is a transform for GregorianCalendar, but what I don't understand is, why Simple can't figure out itself that it should use the GregorianCalendar transform, because there is the class="java.util.GregorianCalendar" attribute on the time element in the XML code (furthermore, I can serialize it, but not deserialize it). Isn't this the same case as if I use the list interface, whereas the XML code will contain something like class="java.util.ArrayList" to denote the concrete instance type? My problem is, I have to serialize a lot of classes which all uses "Calendar" as the type and not the concrete "GregorianCalendar". Of course, all fields hold GregorianCalendar instances, but I can't change all those types at the moment :-/ Is the change from "Calendar" to "GregorianCalender" in all domain model classes really the only option I currently have? Thanks a lot for your help! Best regards, Timo Rumland Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mails are not encrypted and cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. UBS Limited is a company registered in England & Wales under company number 2035362, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS AG (London Branch) is registered as a branch of a foreign company under number BR004507, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS Clearing and Execution Services Limited is a company registered in England & Wales under company number 03123037, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. |