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] initial code commit
Date Wed, 08 Oct 2003 19:58:06 GMT
I would have a look at the Joda typeconvertors.

They concentrate on Object->String and String->Object. Add Object-Object
later if anyone really needs it.

They also have a mechanism for dealing with superclass/subclass
relationships. You can register a TypeConvertorFactory that creates
TypeConvertors for subclasses of a specified type. This is necessary for
enumerated types, where they all fulfil the same interface and you don't
want a specific convertor coded for each enum.

So, the registry starts with a combination of a map of known convertors for
specific classes (no inheritance lookup), and a map of factories by
supertype (with inheritance lookup). The first time a factory is invoked,
the resulting convertor is placed into the first map, thus speeding up
subsequent lookups.

Stephen


----- Original Message -----
From: "Henri Yandell" <bayard@generationjava.com>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Wednesday, October 08, 2003 4:36 AM
Subject: Re: [convert] initial code commit


>
> To save people effort, the design doc is:
>
>
http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/convert/xdocs/convert.
png?rev=HEAD&content-type=text/vnd.viewcvs-markup
>
> Hen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


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