Hi Kumar,

You can use the org.jibx.extras.TypedArrayMapper class in the RC0 code, or use the current CVS code which supports using arrays directly as <collection>s. Using the array directly you can just define the XML representation for the objects in the array with a nested <structure> element inside the <collection>.

 - Dennis

Kumar wrote:

Hi All,

I have below simple class

Customer.java
---------------------
import java.util.*;

public class Customer1 {
   Order[] orderArray = null;

   public void setOrderArray(Order[] orderArray) {
                this.orderArray = orderArray;
        }
   public Order[] getOrderArray() {
                return orderArray;
        }
}



output.xml
----------------
<?xml version="1.0" encoding="UTF-8"?>
<customer>
        <order>
                <orderNumber>10000</orderNumber>
                <orderName>DHL</orderName>
        </order>
        <order>
                <orderNumber>10001</orderNumber>
                <orderName>FedEx</orderName>
        </order>
</customer>




Order class is a simple java bean. Now, my question is can anyone
please tell me how to write binding.xml
for Order[] array in Customer class and I want to produce output.xml
in the format shown above.  I am struck at how to represent array of
objects in binding xml file.
Do we need to write a custom marshaller for this. Can we do without
it. Please suggest ...



Thanks & Regards,
Kumar.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&opÌk
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to