Here you can find the source of unmarshalFromReader(Reader reader, Class> c)
public static Object unmarshalFromReader(Reader reader, Class<?> c) throws JAXBException
//package com.java2s; //## The MIT License import java.io.Reader; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; public class Main { public static Object unmarshalFromReader(Reader reader, Class<?> c) throws JAXBException { Object result = null;/*from ww w. j a v a 2 s . c o m*/ JAXBContext jc = JAXBContext.newInstance(c); Unmarshaller um = jc.createUnmarshaller(); result = um.unmarshal(reader); return result; } public static Object unmarshal(org.w3c.dom.Element elem, Class<?> c) throws JAXBException { Object result = null; JAXBContext jc = JAXBContext.newInstance(c); Unmarshaller um = jc.createUnmarshaller(); result = um.unmarshal(elem); return result; } }