Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Injecting a Map in enum through Spring

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have an Enum with few maps in it. Can I inject the maps through Spring? I am using Spring 2.5

Thanks
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enums are basically static, you cannot inject beans into them. I can think of a few hacks that might get a reference to a bean into an enum, but you can not inject it directly. You might wan't to think about the design of you application first though and see if there is a better way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic