|
From: Geoffrey (JIRA) <no...@at...> - 2005-09-26 14:30:09
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-202?page=comments#action_14771 ] Geoffrey commented on RCP-202: ------------------------------ A similar bug: the source is an instanceof the targetClass, then no conversion should be done. For example I got this error: No converter registered to convert from sourceClass 'class ....OrderParticipantState' to target class 'class java.lang.Enum' (but if you try myOrderParticipantsState instanceof Enum it says true: emumOrderParticipantState is a subclass of Enum because all enums are). > Binding to a superclass should be possible > ------------------------------------------ > > Key: RCP-202 > URL: http://opensource.atlassian.com/projects/spring/browse/RCP-202 > Project: Spring Framework Rich Client Project > Type: Bug > Components: Binding System > Reporter: Geoffrey > Assignee: Oliver Hutchison > > The follow code should called for a conversion from Dog to Animal: > // Dog extends Animal > public class TextToAnimal extends AbstractConverter { > public TextToAnimal () { > } > public Class[] getSourceClasses() { > return new Class[]{String.class}; // subclasses count here > } > public Class[] getTargetClasses() { > return new Class[]{Animal.class}; // subclasses don't count (while they should) > } > protected Object doConvert(Object source, Class targetClass) throws Exception { > // ... > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |