Re: [Simple-support] Deserialization of type Calendar?
Brought to you by:
niallg
|
From: Timo R. <cr...@ol...> - 2008-10-01 16:34:25
|
Hello, > 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). this is really bad news for me. Now I must change all those domain model classes to use GregorianCalendar. And not only this, but every single line that sets the Calendar by using someObject.setTime(Calendar.getInstance()); must now have a cast to GregorianCalendar :-/ > The reason this does not work with class= is because non-annotated > types go straight to the Transformer. But what is the real reason behind the scenes? Unfortunately, I don't know much about the internals of the Simple Framework, but isn't it a possible enhancement to let Simple look at the "class=" attribute and then delegate to the correct Transformer? Are you going to have that "fixed" for a future release, or is this behavior inteded and will not be changed? I still don't understand the difference why this works with a List interface (e.g.: List< String > as the member and ArrayList< String > as the concrete type with "class=java.util.ArrayList" attribute in the XML code), since "List" is also non-annotated. Thanks a lot for all the information Best regards, Timo Rumland |