【文件属性】:
文件名称:webservice、fusioncharts、xml解析
文件大小:1.27MB
文件格式:RAR
更新时间:2018-02-19 11:13:02
webservice
webservice、fusioncharts、xml解析 里面三个项目
public static List parseXml(String xmlStr,String startStr,String endStr,Class clazz){
List reList = new ArrayList();
if(xmlStr==null||"".equals(xmlStr)){
reList = null;
}else{
List tmpList = getStr4Arr(xmlStr,startStr,endStr);
for (String string : tmpList) {
try {
JAXBContext context = JAXBContext.newInstance(clazz);
Unmarshaller unmarshaller = context.createUnmarshaller();
T student = (T)unmarshaller.unmarshal(new StringReader(string));
reList.add(student);
} catch (JAXBException e) {
e.printStackTrace();
}
}
}
return reList;
}