解析xml,OjbectTree转xml
来源:互联网 发布:数据做预测的方法 编辑:程序博客网 时间:2024/05/29 03:32
import com.thoughtworks.xstream.XStream;
/**
* Filter object attributes based on API and permission
*
* @param object
* @param apiName
* @param groupList
* @return
* @throws Exception
*/
public String marshal(Object object, String apiName, List<String> groupList) throws Exception{
XStream xStream = newXStream(apiName, groupList);
/**
* Modified on April 16 to remove � from generated xml string that cannot be parsed by gwt xml parser
*/
String resultXml = xStream.toXML(object);
if (resultXml != null){
resultXml = resultXml.replaceAll("�", "");
}
return resultXml;
}
/**
* Marshal object into xml string
*
* @param object
* @return
* @throws Exception
*/
public String marshal(Object object) throws Exception{
return marshal(object, null, null);
}
/**
* Unmarshal xml string to objects
*
* @param xmlString
* @return
* @throws Exception
*/
public Object unmarshal(String xmlString) throws Exception{
XStream xStream = newXStream(null, null);
return xStream.fromXML(xmlString);
}
- 解析xml,OjbectTree转xml
- SAX解析XML(转)
- XML 解析(转)
- dom4j解析xml(转)
- XML 解析(转)
- XML解析 XML转NSDictionary NSXmlKit
- 【XML】XML解析方式
- 【XML】XML解析方式
- 解析xml xml parser
- xml解析applicationContext.xml
- simple XML解析XML
- [XML] SAX解析XML
- xml-xml解析方式
- 【XML】DOM解析XML
- 【XML】SAX解析XML
- XML语法 XML解析
- XML与XML解析
- Simple XML解析XML
- 使用Boost.Python
- eclipse 重构
- 设置so搜索路径
- VS2008发布程序
- typedef
- 解析xml,OjbectTree转xml
- 安装COCOA2D
- android下通过app名字打开程序(activity)链接
- vs2008编译错误fatal error C1902: 程序数据库管理器不匹配;请检查安装解决
- [网上资料整理]关于标准电阻阻值的说明(E6、E12、E24、E48、E96、E192)
- sendfile优化文件拷贝
- 开始做C++入门必做题(第一题)
- Unbutn eclipse CDT (c/c++)
- VSS 2005服务器与客端配置