DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19857>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19857

Methods ConvertUtilsBean.convert could check for converters registered with base 
classes





------- Additional Comments From [EMAIL PROTECTED]  2003-06-16 07:30 -------
Sorry, but it seems, that you got me wrong. I will try to clarify my request.
Off course I am not speaking about converting to a super-class. That was NOT my
intension. Let me just give you an example: Imagine a class hierarchy starting
with the base-class Enum and two specializations called SexEnum and ColorEnum.
And now there is a instance called 'MyEnumConverter' which is able to convert a
String to the desired sub-class of class Enum.
What I have to do now is, to registrate all sub-classes with the above converter:

ConvertUtils.register(MyEnumConverter, SexEnum.class);
ConvertUtils.register(MyEnumConverter, ColorEnum.class);

For a large hierarchy on the one hand it is a lot of work and on the other hand
as a 'provider of the Enum class' I dont know anything about sub-classes.

So my suggest is to register only the Converter with the base-class although the
converstion itsself leads of course to instances of the specialized type:

Registration:
ConvertUtils.register(MyEnumConverter, Enum.class);

Conversion:
SexEnum sex = (SexEnum) ConvertUtils.convert("male", SexEnum.class);
ColorEnum color = (ColorEnum) ConvertUtils.convert("red", ColorEnum.class);

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to