commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver.He...@t-online.de (Oliver Heger)
Subject Re: [convert]conversion with default values
Date Fri, 19 Mar 2004 18:20:15 GMT
Stephen Colebourne wrote:

[snip]

>The ObjectToInt conversion isn't quite what I had in mind, although
>interestingly the [convert] system does allow it. I want a system where
>there is one converter for Number subclasses to Integer and one for String
>to Integer. The trick is then to design a combination engine to allow
>StringBuffer to Integer by combining StringBuffer to String plus String to
>Integer.
>
>Stephen
>  
>
Sounds interesting. Do you have already concrete ideas how such a 
combination engine would look like? I have thought about converters 
working together in a kind of chain, too, e.g. for String to Integer 
conversion: first try a simple Integer.parseInt() and if this fails, try 
a Locale aware parsing that deals with formatted values. Or conversion 
of arrays or collections of one type into arrays/collections of another 
type: here the converter dealing with the iteration stuff should be 
independent of the converter handling the single elements.

These are all slightly different use cases that should be supported by 
such an engine. What do you think?

Oliver


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message