I want to make generic function that return Object representation of XML document (using JAXB). I need to pass \"class\" object to JAXBContext constructor, but how I can get it
Don't listen to the others... you CAN get it.
Simply change the type of the jaxbClass parameter to Class:
jaxbClass
Class
public T readXmlToObject(String xmlFileName, Class jaxbClass) { JAXBContext context = JAXBContext.newInstance(jaxbClass); ....... }