Here you can find the source of createUnmarshaller(Object object)
@SuppressWarnings("rawtypes") private static Unmarshaller createUnmarshaller(Object object)
//package com.java2s; //License from project: Open Source License import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; public class Main { @SuppressWarnings("rawtypes") private static Unmarshaller createUnmarshaller(Object object) { Class objectClass = object.getClass(); if (objectClass.getSimpleName().equals("Class")) { objectClass = (Class) object; }// www .jav a 2 s . c o m JAXBContext context; Unmarshaller unmarshaller = null; try { context = JAXBContext.newInstance(objectClass); unmarshaller = context.createUnmarshaller(); } catch (JAXBException e) { // TODO Auto-generated catch block e.printStackTrace(); } return unmarshaller; } }