[ 
https://issues.apache.org/jira/browse/FELIX-629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Clement Escoffier resolved FELIX-629.
-------------------------------------

    Resolution: Fixed

Resolved in the 675569 revision.

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}"/>


> Allows instance configuration to declares complex properties
> ------------------------------------------------------------
>
>                 Key: FELIX-629
>                 URL: https://issues.apache.org/jira/browse/FELIX-629
>             Project: Felix
>          Issue Type: Improvement
>          Components: iPOJO
>    Affects Versions: iPOJO-0.8.0
>            Reporter: Clement Escoffier
>            Assignee: Clement Escoffier
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> Instance configurations contain properties. These properties are name-value 
> pair. The value has two possible type : String or another Dictionary. This 
> allows creating deep structure. However, these structure are limited to 
> Dictionary.
> The purpose of this issue is to provide other types such as array, list, and 
> map. Then, an instance configuration  can receive directly a Map, a List or 
> an Array (Object array or String array) directly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to