标签:
xmlstr转化为对象
XStream xstream=new XStream();
xstream.autodetectAnnotations(true);
xstream.alias("User",User.class);
(User)xstream.fromXML(xmlstr);
对象转化为XML
XStream xstream=new XStream();
xstream.processAnnotations(User.class);
...
xstream.toXML(user);
标签:
原文地址:http://www.cnblogs.com/MyITRoad0916/p/5486686.html