title: How to retrieve class of generic argument in a CDI producer?
body: <p>I have a Java class with a generic type. In the business logic of that class, I need to refer to the <code>Class</code> object of the generic type. Therefore, the constructor get the <code>Class</code> object passed as argument:</p>
  
  <pre><code>public class MyClass&lt;GENERIC_TYPE&gt;{
      private Class&lt;GENERIC_TYPE&gt; genericTypeClass;
  
      public MyClass(Class&lt;GENERIC_TYPE&gt; genericTypeClass){
          this.genericTypeClass=genericTypeClass;
      }
  }
  </code></pre>
  
  <p>I create the instance(s) of this class using a CDI producer, whose squeleton looks like</p>
  
  <pre><code>public class MyClassProducer{
      @Produces
      MyClass&lt;GENERIC_TYPE&gt; createMyClass(InjectionPoint injectionPoint){
          Class&lt;GENERIC_TYPE&gt; genericTypeClass = ????
          return new MyClass(genericTypeClass);
      }
  }
  </code></pre>
  
  <p>How do I retrieve <code>genericTypeClass</code> ?</p>