title: Get Package Name of Generic Type Argument
body: <p>How can I get the package name (in general, the class) of a generic type argument? I have a class similar to this:</p>
  
  <pre><code>public class MyClass&lt;T&gt; {}
  </code></pre>
  
  <p>What I'd like to do is something like this (non-working pseudo-Java):</p>
  
  <pre><code>return T.class.getPackage().getName();
  </code></pre>
  
  <p>I need this, since JAXB needs this as the context path (<code>JAXBContext.newInstance(String)</code> method). Of course I'm open to more elegant ways of working with <code>JAXBContext</code>. :)</p>
  
  <p>Cheers
  Matthias</p>