org.oddjob.arooa.types
Class ListType

java.lang.Object
  extended by org.oddjob.arooa.types.ListType
All Implemented Interfaces:
Serializable, ArooaValue

public class ListType
extends Object
implements ArooaValue, Serializable

Description

A list provides a way of setting properties that are either 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 ArooaValue.

Example

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

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>
See Also:
Serialized Form
Author:
Rob Gordon.

Nested Class Summary
static class ListType.Conversions
           
 
Field Summary
static ArooaElement ELEMENT
           
 
Constructor Summary
ListType()
           
 
Method Summary
 void configured()
           
 Class<?> getElementType()
           
 ArooaValue getValues(int index)
           
 boolean isMerge()
           
 boolean isUnique()
           
 void setElementType(Class<?> elementType)
           
 void setMerge(boolean merge)
          Setter for merge.
 void setUnique(boolean unique)
          Set unique.
 void setValues(int index, ArooaValue element)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ELEMENT

public static final ArooaElement ELEMENT
Constructor Detail

ListType

public ListType()
Method Detail

configured

public void configured()

setElementType

public void setElementType(Class<?> elementType)

getElementType

public Class<?> getElementType()

setValues

public void setValues(int index,
                      ArooaValue element)

getValues

public ArooaValue getValues(int index)

toString

public String toString()
Overrides:
toString in class Object

isMerge

public boolean isMerge()
Returns:
Returns the merge.

setMerge

public void setMerge(boolean merge)
Setter for merge.

Parameters:
merge -

setUnique

public void setUnique(boolean unique)
Set unique.

Parameters:
unique -

isUnique

public boolean isUnique()