castor marshall question


XML & Web services: castor marshall question

  1. castor marshall question (1 messages)


    I use castor to marshall a java object. There are three objects Service, Group and Unit. The Service object includes a collection of Group. The Group object includes a collection of Unit. Obviously, there are two layers here. When I try to marshall service object, Castor successfully marshall the collection of Group object but can't do correctly for the collection of Unit in the Group object.

    The result is below:
      <name>2nd group</name>
      <all-unit xsi:type="java:java.util.AbstractList$Itr" xmlns:xsi="" />

    mapping file looks like below:
      <class name="Service">
        <map-to xml="service"/>
        <field name="name">
          <bind-xml name="name" node="element"/>
        <field name="groups" collection="collection" type="Group">
          <bind-xml name="group"/>
      <class name="Group" auto-complete="true">
        <field name="groupName">
          <bind-xml name="name" node="element"/>
        <field name="units" collection="collection" type="Unit">
          <bind-xml name="unit"/>
      <class name="Unit" auto-complete="true">
        <field name="unitName">
          <bind-xml name="name" node="element"/>
        <field name="groupName">
          <bind-xml name="groupName" node="element"/>

    I'm just wondering if castor doesn't support recursive marshall of collection field.

    Does anyone know that? Thanks in advance.

  2. sorry,a mistake from me[ Go to top ]

    please ignore it