Way back in the dawn of Expression 2.0 - we messed around with the 
concept of providing a bit more information as part of the context.
ie Integer+strict vs Integer+lax 

At the time we did not figure we knew enough about what went into 
context to strictly define what is needed; and rather than going ad-hoc 
and making stuff up we went directly with a Class.

Now if you guys want to fake it ...
Integer.class - is lax
Integer.Type.getClass() - is strict

Jody

> Justin Deoliveira ha scritto:
>   
>> Hi Andrea,
>>
>> Your hitting on some definite issues with the api... and ones i am 
>> ashamed to say i have hacked around in the past :(. So here is what I 
>> think is needed:
>>
>> 1. A way to do only *safe* vs *lax* conversions
>>     
>
> Where safe conversion means "12.5" cannot be converted to a integer in
> any way, right? Possibly even "12.0", since new Integer("12.0") bombs
> out in java (and making a converter that handles the conversion in
> all cases, even with very numbers that go beyond the range of basic 
> types, is a real mess).
>
>   
>> 2. A way to prioritize or sort factories
>>
>> So i would recommend the following:
>>
>> 1. Add a method to Converter"
>>
>> boolean isSafe();
>>
>> Then we also add an additional method to Converters called convert( ..., 
>> boolean safe ), which would only allow safe coverters to execute.
>>
>> 2. Add a method to ConverterFactory:
>>
>> int getPriority();
>>
>> And then sort on it when the converter factories are loaded.
>>
>> What do folks think?
>>     
>
> That works for me :)
> Cheers
> Andrea
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save $100. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to