Adam,

I just tried marshalling and unmarshalling the following and it works fine for me with Castor 0.9.9, with and without a mapping file:

package com.acme;

public class Foo {

    private String[] _values = null;

    public Foo() {
        super();
    }

    public String[] getValues() {
        return _values;
    }

    public void setValues(String[] value) {
        _values = value;
    }

}

<mapping>
   <class name="com.acme.Foo">
      <field name="values" type="string" collection="array"/>
   </class>
</mapping>

--Keith

Adam Hiatt wrote:
I'm having trouble mapping the basic array of strings.  Something like this:
When I marshall it I end up with a line like:

---------------------
<STREET value="[EMAIL PROTECTED]"/>
----------------------

public class FlatAddress
{
    private String[]    streets;
    private String    floor;
    private String    room;
    private String    suite;
    private String    city;
.... with getters and setters.
}
Mapping file:

<class name="FlatAddress">

<map-to xml="ADDRESS"></map-to>
<field name="buildingName" type="string">
<bind-xml name="value" node="attribute" location="BUILDING_NAME"></bind-xml>
</field>

<field name="streets" type="java.lang.String" collection="array" get-method="getStreets" set-method="setStreets" >

<bind-xml name="value" node="attribute" location="STREET" ></bind-xml>

</field>

<field name="floor" type="string">

<bind-xml name="value" node="attribute" location="FLOOR" ></bind-xml>

</field>

<field name="room" type="string">

<bind-xml name="value" node="attribute" location="ROOM" ></bind-xml>

</field>

.....

<ADDRESS>

<BUILDING_NAME value="buildingNameValue1"/>

<STREET value="[EMAIL PROTECTED]"/>

<FLOOR value="floorValue1"/>

<ROOM value="roomValue1"/>

<SUITE value="suiteValue1"/>

<CITY value="cityValue1"/>

</ADDRESS>
--
----------------------
Adam Hiatt
----------------------


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

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

Reply via email to