My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 62: field serialization order not upheld for deserialization
1 person starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Oct 2012


 
Reported by j...@antitheorystudio.com, Oct 23, 2012
The order in which fields are deserialized seems to be "random", even when specifying an order using [XmlClass(ordered="true")]

This means that if you are using serializePartialElement for certain objects you cannot force the deserializer to deserialize the full element first and then rely on the ObjectCache to deserialize the partialElement when it is referenced "later" in the XML.

Might there be another way of going about this?

<book>
<pictures>
 <picture id="1">
   <url>
      some_pic.jpg
   </url>
   <caption>
      This is a caption
   </caption>
 </picture>
</pictures>
<pages>
   <page id="2">
      <picture id="1"/>
      <text>
         The picture is on the first page
      </text>
   </page>
   <page id="3">
      <picture id="1"/>
      <text>
        And on the second page
      </text>
   </page>
</pages>
</book>

Oct 23, 2012
Project Member #1 alex.id....@gmail.com
Is this on the latest version?
Also, when using the ordered flag on the class you should specify the order index on each field. Since FlexXb is based on xml descriptor of the type, it cannot guarantee that teh order in which the variables are defined is the order they are present in the xml descriptor.
Did you add the order flag to each of your fields and still the same result?
Oct 23, 2012
#2 j...@antitheorystudio.com
Ok this is quite  embarassing... It works as expected. Turns out I spelled ordered wrong. This is why annotation syntax bothers me so!
Oct 23, 2012
Project Member #3 alex.id....@gmail.com
I feel you. Unfortunately right now it is the only way.
Hey, you do get the autocomplete on annotations, right? I've included a while ago the xml descriptor for annotations which is read by FlashBuilder. You require Flash Builder 4 at least,  I think.
Oct 23, 2012
Project Member #4 alex.id....@gmail.com
(No comment was entered for this change.)
Status: Invalid
Oct 23, 2012
#5 j...@antitheorystudio.com
I am using FlashDevelop... It doesn't seem to autocomplete inside annotations.

Funnily enough, I had a another similar problem today with your framework, I was using ConstructorArgument instead of ConstructorArg! I managed to solve that one without opening an issue though :)

Powered by Google Project Hosting