Possible Duplicate:
how to get class instance of generics type T
Template's T at
JAXBContext jaxbContext = JAXBContext.newInstance(T.class);
can not compile T.class , do it need reflection and how?
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);
}