how to write T.class in java?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3437897/how-to-get-class-instance-of-generics-type-t">how to get class instance of generics type T</a>  </p>
</blockquote>



<p>Template's T
at</p>

<pre><code>JAXBContext jaxbContext = JAXBContext.newInstance(T.class);
</code></pre>

<p>can not compile T.class , do it need reflection and how?</p>

<pre><code>    public void ConvertObjectToXML(String path, T bobject)
    {
        //Convert XML to Object
        File file = new File(path);
        JAXBContext jaxbContext = JAXBContext.newInstance(T.class);

        Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
        T customer2 = (T) jaxbUnmarshaller.unmarshal(file);
        System.out.println(customer2);
    }
</code></pre>
