From: Matt B. <gud...@ya...> - 2008-01-03 22:28:02
|
In using ChainedTransformer I find I have to jump through hoops at times to pick the proper transformation path, particularly with the TextConverter. If it happens to pick char, Character, or null as a conversion step between e.g. a "to-text" converter and a "from-text" converter, data is lost. I am thinking of an interface like this: public interface ImpreciseConverter extends Converter { boolean isImpreciseConversion(Class destinationClass, Class sourceClass); } The default implementation on BaseTransformer: public boolean isImpreciseConversion(Class destinationClass, Class sourceClass) { return destinationClass == null && sourceClass != null; } TextConverter would report that a conversion from a string to null or char is imprecise. ChainedTransformer could then be coded to avoid imprecise conversions when possible. WDYT? -Matt B ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs |