xs.autodetectAnnotations(true);
/** * xml解析函数 * @param String xml信息 * @return String 接口返回信息 */ public static Object toObject(String xml,Class mainclass){ XStream xs = new XStream(new DomDriver()); xs.autodetectAnnotations(true); xs.processAnnotations(mainclass); Object obj= xs.fromXML(xml); return obj; }
时间: 2024-12-12 21:51:59