commons-dev mailing list archives

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


>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
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?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message