commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <>
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.


----- Original Message -----
From: "Henri Yandell" <>
To: "Jakarta Commons Developers List" <>
Sent: Wednesday, October 08, 2003 4:36 AM
Subject: Re: [convert] initial code commit

> To save people effort, the design doc is:
> Hen
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message