Defining Arrays of Objects

<objs><obj id="myId" type="my.class.Type" hint="array" >...</obj><objs>

To define an array of objects you have to specify the hint="array". The structure is the same as used in collection datatype definition.
Here comes an example:

 <test id="myFirstTestCase">
   <objs>
     <obj id="myObj" type="int" hint="array">
       <item>4711</item>
       <item>4712</item>
     </obj>
   </objs>
 </test>
Using this object is equivalent to use:
Integer [] myObj = { new Integer(4711), new Integer(4712)};

If you want to specify an empty array of an array of a certain size you can proceed like this:

<obj id="myObj" type="int" hint="array" />
will specify an integer array of size 1 with null element.
<obj id="myObj" type="int" hint="array">3<obj>
will specify an array of size 3 will "null" elements.

So the only way to assigning an array object to "null" is the explizit way

<obj id="myObj" type="int" hint="array">!NULL!<obj>
sf logo