title: How to get a Class literal from a generically specific Class
body: <p>There are methods like these which require Class literals as argument.</p>
  <pre><code>Collection&lt;EmpInfo&gt; emps =  
    SomeSqlUtil.select(  
    EmpInfo.class,  
    &quot;select * from emps&quot;);
  </code></pre>
  <p>or</p>
  <pre><code>GWT.create(Razmataz.class);
  </code></pre>
  <p>The problem presents itself when I need to supply generic specific classes like</p>
  <pre><code>EmpInfo&lt;String&gt;
  Razmataz&lt;Integer&gt;
  </code></pre>
  <p>The following would be wrong syntax</p>
  <pre><code>Collection&lt;EmpInfo&lt;String&gt;&gt; emps =  
    SomeSqlUtil.select(  
    EmpInfo&lt;String&gt;.class,  
    &quot;select * from emps&quot;);
  </code></pre>
  <p>or</p>
  <pre><code>GWT.create(Razmataz&lt;Integer&gt;.class);
  </code></pre>
  <p>Because you cannot do syntax like</p>
  <pre><code>Razmataz&lt;Integer&gt;.class
  </code></pre>
  <p>So, how would I be able to squeeze a class literal out of</p>
  <pre><code>EmpInfo&lt;String&gt;
  Razmataz&lt;Integer&gt;
  </code></pre>
  <p>so that I could feed them as arguments to methods requiring Class literals?</p>
  <h3>Further info</h3>
  <p>Okay, I confess that I am asking this primarily for GWT.</p>
  <p>I have a pair of GWT RPC interface Razmataz. (FYI, GWT RPC interface has to be defined in server-client pairs). I plan to use the same interface pair for communicating whether it be String, Integer, Boolean, etc.</p>
  <p><code>GWT.create(Razmataz)</code> for <code>Razmataz&lt;T&gt;</code>
  complains that, since I did not specify T, GWT compiler treated it as Object. Then GWT compiler would not accept Object class. It needs to be more specific than being an Object.</p>
  <p>So, it seems there is no way for me to tell GWT.create what T is because a Class literal is a runtime concept while generics is a compile time concept, Right?</p>