[Index]

convert


Convert a value to the given Java Class.

Property Summary

is The result of the conversion.
to The name of the java class to convert to.
value The value to convert.

Example Summary

Example 1 Convert a delimited list to an array of Strings.

Property Detail

is

AccessREAD_ONLY
RequiredRead Only.

The result of the conversion.

to

Configured ByELEMENT
AccessREAD_WRITE
RequiredYes.

The name of the java class to convert to.

value

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo. If missing the result of the conversion will be null.

The value to convert.


Examples

Example 1

Convert a delimited list to an array of Strings.

<oddjob id="this">
    <job>
        <foreach>
            <values>
                <convert>
                    <to>
                        <class name="[Ljava.lang.String;"/>
                    </to>
                    <value>
                        <value value="&quot;grapes, red&quot;, &quot;grapes, white&quot;, gratefruit"/>
                    </value>
                </convert>
            </values>
            <configuration>
                <xml>
                    <foreach id="loop">
                        <job>
                            <echo>${loop.current}</echo>
                        </job>
                    </foreach>
                </xml>
            </configuration>
        </foreach>
    </job>
</oddjob>


(c) Rob Gordon 2005 - 2013