title: How to get java.lang.Type object of a self-defined class object?
body: <p>I want to use Java <code>Generics</code> feature to implement a common functionality. But I don't know hot to get a <code>java.lang.reflect.Type</code> object for a self-defined class object. Following is my case that I want to get a Type from a given class name and pass it to <code>ProcessedResult&lt;T&gt;</code> to replace <code>T</code>:</p>
  
  <pre><code>String className = getClassName();
  Class clazz = Class.forName(className);
  Type type = null;
  ProcessedResult&lt;T&gt; result = new ProcessedResult&lt;T&gt;();
  </code></pre>
  
  <p>I try to use <code>ProductModel.class.getGenericSuperclass()</code>, but as its name, it only return Type of its super class.</p>
  
  <p>Can anybody gives me help? Thanks.</p>