Log Message: |
Fix the issue Felix-629
Allows an instance configuration to contain complex types.
Now an instance configuration can contain properties like :
<instance component="org.apache.felix.ipojo.test.scenarios.component.ComplexConfiguration" name="complex">
<property name="array" type="array"> <!-- creates an array -->
<property value="a"/>
<property value="b"/>
</property>
<property name="list" type="list"> <!-- creates a list -->
<property value="a"/>
<property value="b"/>
</property>
<property name="dict" type="dictionary"> <!-- creates a dictionary (default case) -->
<property name="a" value="a"/>
<property name="b" value="b"/>
</property>
<property name="map" type="map"> <!-- creates a map -->
<property name="a" value="a"/>
<property name="b" value="b"/>
</property>
<property name="complex-array" type="array"> <!-- creates an array containing lists -->
<property type="list">
<property value="a"/>
<property value="b"/>
</property>
<property type="list">
<property value="c"/>
<property value="d"/>
</property>
</property>
<property name="complex-list" type="list"> <!-- creates a list containing lists -->
<property type="list">
<property value="a"/>
<property value="b"/>
</property>
<property type="list">
<property value="c"/>
<property value="d"/>
</property>
</property>
<property name="complex-map" type="map"> <!-- creates a map containing lists -->
<property name="a" type="list">
<property value="a"/>
<property value="b"/>
</property>
<property name="b" type="list">
<property value="c"/>
<property value="d"/>
</property>
</property>
</instance>
As illustrated, any complex type can contain any complex type (and obviously itself). When no sub-property is declared, an empty structure is returned.
The patch contains also code allowing to use [...] to describe an array instead of {...}. So it is possible to write something like : <property name="foo" type="String[]" value="[a, b, c]"/>. This is equivalent to the existing syntax : <property name="foo" type="String[]" value="{a, b, c}"/>
|