title: Spring autowire interface
body: <p>I have an Interface IMenuItem</p>
  
  <pre><code>public interface IMenuItem {
  
      String getIconClass();
      void setIconClass(String iconClass);
  
      String getLink();
      void setLink(String link);
  
      String getText();
      void setText(String text);
  
  }
  </code></pre>
  
  <p>Then I have a implementation for this interface</p>
  
  <pre><code>@Component
  @Scope("prototype")
  public class MenuItem implements IMenuItem {
  
      private String iconClass;
      private String link;
      private String text;
  
      public MenuItem(String iconClass, String link, String text) {
          this.iconClass = iconClass;
          this.link = link;
          this.text = text;
      }
  
      //setters and getters
  
  }
  </code></pre>
  
  <p>Is there any way to create multiple instances of MenuItem from a configuration class, using only the IMenuItem interface? with @autowired or something ? Also is it possible to autowire by specifying the arguments of the constructor ?</p>