[Index]

arooa:conversion


Provide a Bean for use in an arooa:descriptor that provides conversions.

Property Summary

className The class name of the conversion.
methodName The name of the method that provides the conversion if the conversion is not an org.oddjob.arooa.convert.ConversionProvider.

Example Summary

Example 1 Creating Gremlins

Property Detail

className

Configured ByATTRIBUTE
AccessREAD_WRITE
Requiredyes.

The class name of the conversion. If a method is provided then this is the name of the class that has that method and the conversion will be from objects of that class to the return type of the method. If method is provided then this class name must refer to an org.oddjob.arooa.convert.ConversionProvider.

methodName

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The name of the method that provides the conversion if the conversion is not an org.oddjob.arooa.convert.ConversionProvider. The conversion will be provided via reflection at runtime using this method. The return type of this method is used to register the conversion 'to' class.


Examples

Example 1

Creating Gremlins

<oddjob id="oddjob">
    <job>
        <oddjob file="${oddjob.dir}/ReflectionConversionExample.xml" id="example">
            <descriptorFactory>
                <arooa:descriptor xmlns:arooa="http://rgordon.co.uk/oddjob/arooa">
                    <conversions>
                        <arooa:conversion className="org.oddjob.arooa.convert.gremlin.GremlinSupplier" methodName="get"/>
                    </conversions>
                </arooa:descriptor>
            </descriptorFactory>
        </oddjob>
    </job>
</oddjob>
<oddjob>
    <job>
        <sequential>
            <jobs>
                <variables id="vars">
                    <gremlin>
                        <bean class="org.oddjob.arooa.convert.gremlin.GremlinSupplier" name="Gizmo"/>
                    </gremlin>
                </variables>
                <bean class="org.oddjob.arooa.convert.gremlin.ThingWithGremlin" id="thing">
                    <myGremlin>
                        <value value="${vars.gremlin}"/>
                    </myGremlin>
                </bean>
            </jobs>
        </sequential>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present