Justin Deoliveira ha scritto: > Hi Emily, > > Emily Gouge wrote: >> Thanks for the info Justin. (Sorry I'm slow getting back to you; I was >> away last week). >> >> If I work at implementing this can I bug you for help and ask you to >> review the work as I go along? I'm sure I'll need some advice on how to >> do things properly. > Yeah for sure. Basically the general idea is this. The first part is > easy, just add a public hint to the Converters class (or maybe > ConvterFactory): > > public static final Key SAFE_CONVERSION = new Key(Boolean.class); > > Then the next step is hunt down every implementation of the Converter > interface, and have it respect the SAFE_CONVERSION hint if it is set. > Off the top of my head this mostly applies to the NumericConverter, and > the TemporalConverter. > > One hitch i notice is that while ConverterFactory.createConverter() > takes a map of hints, Converter.convert() does not. So we probably have > to add a method to the Converter interface.
Agreed >> Lastly - how do we define a "Safe Conversion"? Is this something we can >> define or is this well defined somewhere. I'm thinking that converting >> from integer to double is probably safe but not so for double to >> integer. I'm sure the other types have similar properties. > I guess any conversion that may result in any loss of information (a > lossy conversion) would be considered unsafe? Perhaps someone has a more > precise definition. Sounds good enough to me :) Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel