In the example below, the correct mapping would look something like....

<class name="Test"...>
<field name="list" type="You need a type here - and it's not list, it's the object in the list" collection="arraylist">
        <bind-xml name="something" type="something else">
    </field>
</class>

Remember that the type you're actually marshalling/unmarshalling is the contents of the list; the fact that it's stored and accessed via a List object is held in the collection information, but what you're really trying to describe to castor is the contents of that list. The type of the field isn't a List; it's a list (as the collection attribute says) of X. Type wants to know what X is; collection described the list.


On 2 Aug 2005, at 07:07, venkatesh babu wrote:

Hi,

I have a problem of unmarshalling, In my class one member variable (List list) is there, in my xml i am getting some arraylist of objects and try to set it in the list, will it be possible, or i have to do any changes in the properties file.


Class Test
{
    List list;

    public void setList(List list){
        this.list = list;
    }

    public List getList(){
        return this.list
    }

}



-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to