org.oddjob.arooa.convert
Interface Convertlet<F,T>

All Known Subinterfaces:
FinalConvertlet<F,T>

public interface Convertlet<F,T>

A Convertlet provides a single conversion from an object of a certain type to an object of a different type.

Convertlets are provided by ConversionProvider in an ArooaDescriptor.

Convertlets are used in sequences. A conversion from Float to Integer uses to Convertlets. Float to Number and Number to Integer. If a convertlet isn't to be used as part of a sequence it should be declared as a FinalConvertlet.

A Convertlet can always assume that they will not be used for an inappropriate conversion and so do not have to do any type checking.

Author:
rob

Method Summary
 T convert(F from)
          Convert from one thing to another.
 

Method Detail

convert

T convert(F from)
          throws ConvertletException
Convert from one thing to another.

Parameters:
from - The from object, never null.
Returns:
The conversion. Can be null.
Throws:
ConvertletException - If conversion failed - for instance a number or date can't be parsed.