5 Replies Latest reply on Nov 23, 2012 4:48 PM by Gavin Dmello

    Inject a Map - Spring DI alternative

    Gavin Dmello Newbie

      I'm a newbie, and looking to replace Spring DI with CDI. I'm trying to find a simple way to replace a similar configuration to the one below in Spring with a weld CDI equivalent-



      <bean id="CreditCardHandlerMap" class="org.springframework.beans.factory.config.MapFactoryBean">

              <property name="targetMapClass">



              <property name="sourceMap">

                  <map key-type="com.mycompany.enums.CreditCardTypeEnum">

                      <entry key="VISA" value-ref="VisaHandler"/>

                      <entry key="MASTERCARD" value-ref="MasterCardHandler"/>








      public enum CreditCardTypeEnum implements IsSerializable, Serializable {




                private String description;


                private CreditCardTypeEnum(String description) {

                          this.description = description;




                public String getDescription() {

                          return this.description;




      I've searched for a simple solution, and have not been able to find one. Is there a simple approach?