Hello,
I have a class Foo with a property "level" of type LevelEnum (a Java 5 enum). How can one set the property in a spring xml configuration file? For example the following does not work, failing with a TypeMismatchException because Spring doesn't know how to convert the String to a LevelEnum. So what to do?
Brian
<bean id="foo" class="Foo">
<property name="level"><value>high</value></property>
</bean>
Code:public class Foo { private LevelEnum level; public LevelEnum getLevel() { return level; } public void setLevel(LevelEnum level) { this.level = level; } enum LevelEnum{ low, medium, high } ... }


Reply With Quote
