[Index]

list


A list provides a way of setting properties that are either java.util.List types or arrays. A list can include any other type including another list or array type.

Handling of multi-dimensional arrays has not been considered. Such properties are probably best defined with a custom org.oddjob.arooa.ArooaValue.


Property Summary

elementType The required element type.
merge If the element is a list or array the values are merged into this list.
unique Ensures the list contains only unique elements.
values Any values.

Example Summary

Example 1 A simple list of things.
Example 2 A Merged list.

Property Detail

elementType

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo. Elements will be left being what they want to be.

The required element type. If this is specified all elements of the array will attempt to be converted to this type.

merge

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo, defaults to not merging.

If the element is a list or array the values are merged into this list.

unique

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

Ensures the list contains only unique elements.

values

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

Any values.


Examples

Example 1

A simple list of things.

 <list id="list">
  <values>
   <value value="Hello World"/>
   <value value="Goodbye World"/>
   <list>
    <values>
     <value value="I'm in another list"/>
    </values>
   </list>
  </values>
 </list>
 

Example 2

A Merged list. This list merges a plain value, a sub list and and array which is Oddjobs command line arguments.

<oddjob id="this">
    <job>
        <sequential>
            <jobs>
                <variables id="vars">
                    <aList>
                        <list merge="true">
                            <values>
                                <value value="apples"/>
                                <list>
                                    <values>
                                        <value value="oranges"/>
                                        <value value="bananas"/>
                                    </values>
                                </list>
                                <value value="${this.args}"/>
                            </values>
                        </list>
                    </aList>
                </variables>
                <foreach>
                    <values>
                        <value value="${vars.aList}"/>
                    </values>
                    <configuration>
                        <xml>
                            <foreach id="loop">
                                <job>
                                    <echo>${loop.current}</echo>
                                </job>
                            </foreach>
                        </xml>
                    </configuration>
                </foreach>
            </jobs>
        </sequential>
    </job>
</oddjob>


(c) Rob Gordon 2005 - 2013