首页 > 其他 > 详细

Xstream解析报文

时间:2014-11-02 16:17:38      阅读:460      评论:0      收藏:0      [点我收藏+]

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;
    }

 

Xstream解析报文

原文:http://www.cnblogs.com/lgtrajectory/p/4069355.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!