67,541
社区成员
发帖
与我相关
我的任务
分享
public static Object XmlToBean(String xml,Class parent,Class child) throws JAXBException{
JAXBContext context = JAXBContext.newInstance(parent,child);
Unmarshaller unmarshaller = context.createUnmarshaller();
return JAXB.unmarshal(new StringReader(xml),child)
}