injecting values from an enum into a spring bean

Posted on Saturday, June 12, 2010


Recently we had a requirement to inject an enum into a spring bean. To inject all the values of the enum we did the following

<bean id="elementTypes" factory-method="values">

and the following attribute in the spring bean was defined as

public class CompanyScoreMasterStatement implements CompanyEventStatement {

 private EPStatement statement;

 private ScoreElementType[] elementTypes;
Posted in: Java, Tip