title: Is it possible to get a class by qualifier annotation using reflection?
body: <p>I have an interface with many possible implementations. The right implementation should be chosen at the runtime. And so Reflection sounds to be the solution.</p>
  
  <p>I have annotated these classes by a qualifier that has as argument an enumeration.</p>
  
  <p>So, is it possible to get at runtime using reflection the right implementatoin class by passing the right enumeration to the annotation?</p>
  
  <p>But, reflection is not mandatory if there is another way..</p>
  
  <p>First, here it is the enumeration :</p>
  
  <pre><code>public enum CATEGORY {
   A,B,C;
  }
  </code></pre>
  
  <p>Then, here it the interface :</p>
  
  <pre><code>public interface GenericI{
     void method1(CATEGORY arg);
     // some other methods
  }
  </code></pre>
  
  <p>And now, here there are the annotated implementations :</p>
  
  <pre><code>@MyAnnotation(CATEGORY.A)
  public class impl1 implements GenericI{
      void method1(CATEGORY arg){
         // some work here
      }
  }
  
  @MyAnnotation(CATEGORY.B)
  public class impl2 implements GenericI{
      void method1(CATEGORY arg){
         // some work here
      }    
  }
  </code></pre>
  
  <p>Finally, the proxy that at a way, select <strong>dynamically</strong> the right implementation using annotation and enumeration (probably it shouldn't implement GenericI ??): </p>
  
  <pre><code>public class MyProxy implements GenericI {
  
    // Here we must be able to select the right implementation
  }
  </code></pre>