I guess you can use a set-method for this collection and you can assign 
an empty collection if the given collection is null. You may want to 
have a look at the documentation of the set-method attribute at 
http://jibx.sourceforge.net/details/binding-attributes.html#property

regards..


Christian Bourque wrote:
> Hi!
>
> Is this a normal behavior that the collection of an object is null
> after unmarshalling it when that collection is initialized in the
> constructor?
>
> I know that my XML in this example doesn't contain any element for
> this collection but still I would like it to be initialized to an
> empty collection instead of null! The logic of the code is based on
> this assumption and cannot be changed!
>
> Is it Jibx that does this afterward the constructor was called? Is
> there a workaround?
>
> Thanks
>
> Christian
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> jibx-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to