*
* @throws ConverterNotFoundException
* if {@link BaseConverter}is not found
*/
public Converter findConverter(String fromType, String toType) throws ConverterNotFoundException {
if (fromType == null || toType == null) throw new ConverterNotFoundException(fromType, toType);
if (fromType.equals(toType)) {
return new IdenticalConverter();
}
else if ("Object".equals(fromType) || "Object".equals(toType)) {
return new IdenticalConverter();
}
else {
Converter result = ((Converter) converters.get(new ConverterKey(fromType, toType)));
if (result == null) throw new ConverterNotFoundException(fromType, toType);
return result.newConverter();
}
}