title: Spring dynamic Qualifier
body: <p>I have an interface Shape</p>
  
  <pre><code>public interface Shape {
      String draw();
  }
  </code></pre>
  
  <p>And two implementations for the above Shape interface</p>
  
  <pre><code>@Component("triangle")
  public class Triangle implements Shape {
      public String draw() {
          return "drawing Triangle";
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@Component("circle")
  public class Circle implements Shape {
      public String draw() {
          return "Drawing Circle";
      }
  }
  </code></pre>
  
  <p>In my client code if I have to decide which Shape class to use at run time based on Qualifier </p>
  
  <pre><code> @Autowired
      private Shape shape;
  @GET
      @Produces(MediaType.TEXT_HTML)
      @Path("/shape")
      public String getShape(@PathParam("type")
      String type) {
          String a = shape.draw();
          return a;
      }
  </code></pre>
  
  <p>How to do it?
  I want to pass "type" which I get as a pathparam to decide which Shape object to be injected at run time. Please help me in resolving this issue.</p>