Re: Deserialization returns null for ArrayList

34 views
Skip to first unread message
Message has been deleted

Alexutz

unread,
Oct 18, 2013, 1:53:20 PM10/18/13
to fle...@googlegroups.com
[XmlArray (alias="*",type="com.ep.ff.flex.screen.BeanXMLTag")]
            public var beanList : ArrayList;

 

This is the case in which FlexXb can't work on deserialization because there's no solid method of determining the proper elements to be added to the list. It is also explained in the documentation. Wrap the list with an element name and you will be back in business (set alias to something),
 
Alex

On Friday, October 18, 2013 8:39:42 PM UTC+3, Rajalakshmi Thangaraj wrote:
Hi,
 
I am trying to deserialize a Class, which has an ArrayList in it, after deserialization I am able to get all the attributes, but not the arraylist, which is always coming as null.
 
Below is the class and on deserialization "beanList" is coming null.
 

package com.ep.ff.flex.screen

{

      import com.googlecode.flexxb.interfaces.IIdentifiable;

     

      import mx.collections.ArrayList;

     

      [XmlClass(alias="beans")]

      [ConstructorArg(reference="id")]

     

      [Bindable]

      public class ParentBeansXMLTag implements IIdentifiable

      {

            [XmlAttribute (alias="id")]

            public var id : String;

            [XmlAttribute (alias="xmlns")]

            public var xmlns : String = "http://www.springframework.org/schema/beans";

           

            [XmlAttribute (alias="xmlns:xsi")]

            public var xmlnsXsi : String = "http://www.w3.org/2001/XMLSchema-instance";

           

            [XmlAttribute (alias="xmlns:util")]

            public var xmlnsUtil : String = "http://www.springframework.org/schema/util";

           

            [XmlAttribute (alias="xsi:schemaLocation")]

            public var xmlnsSchema : String = "http://www.springframework.org/schema/beans"+

                          " http://www.springframework.org/schema/beans/spring-beans.xsd"+

                          " http://www.springframework.org/schema/util"+

                          " http://www.springframework.org/schema/util/spring-util.xsd";

           

            [XmlArray (alias="*",type="com.ep.ff.flex.screen.BeanXMLTag")]

            public var beanList : ArrayList;

           

            [XmlElement(alias="utillist")]

            public var utilList :UtilListXMLTag;

           

            public function ParentBeansXMLTag(id: String)

            {

                  super();

                  this.id = id;

            }

           

            public function get thisType():Class

            {

                  return ParentBeansXMLTag;

            }

      }

}

Reply all
Reply to author
Forward
Message has been deleted
0 new messages