commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [convert]conversion with default values
Date Fri, 19 Mar 2004 00:06:24 GMT
I comitted an updated version of the default converter and factory to CVS. I
felt that a common superclass was inappropriate as it was merely being used
for sharing code rather than a true inheritance relationship. I still need
to fix the tests to match.

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

----- Original Message -----
From: "Oliver Heger" <hegero@med.uni-marburg.de>
> I created a patch in bugzilla (bug ID 27639) that implements a
> conversion that supports default values if either null values are to be
> converted or a conversion causes an exception. This conversion and its
> corresonding conversion factory are implemented as decorators so they
> can be attached to arbitrary other conversions.
>
> To get a better understanding for the convert2 codebase I tried to write
> a simple Object to Integer conversion. I ended up with a base class for
> conversions from Object to arbitrary types, which should simplify
> construction of concrete conversions and their factories. I think now I
> understand what you meant by "support of inheritence without bothering
> the registry". These base classes and the Object to Integer conversion
> classes are also in the patch file. I hope this is useful.
>
> 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