title: Can I have Spring's @Component on enum?
body: <p>I'm using Spring 3.0.x and following the enum singleton pattern for one of my implementatons.</p>
  
  <pre><code>public enum Person implements Nameable {
      INSTANCE;
  
      public String getName(){
          // return name somehow (Having a variable but omitted for brevity)
      }
  }
  </code></pre>
  
  <p>Recently we started to collecting those types via Spring so I need to add @Component to my class.</p>
  
  <pre><code>@Component
  public enum Person implements Nameable {
      INSTANCE;
  
      public String getName(){
          // return name somehow (Having a variable but omitted for brevity)
      }
  }
  </code></pre>
  
  <p>and collecting method is</p>
  
  <pre><code>@Autowired
  public void collectNameables(List&lt;Nameable&gt; all){
      // do something 
  }
  </code></pre>
  
  <p>After doing this I observed failures and cause was Spring cannot intialize enum classes (which is understandable).<br/><br/>
  My question is - <br/>
  Is there any other way usign which I can mark my enum classes as a bean ? <br/>
  Or i need to change my implementation?</p>