/**
* To xml.
*
* @param obj
* the obj
* @return the string
*/
// ////////////////////////////////////////////////////////////////////
public static String toXml(final Object obj) {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
// XStream x = createXStream();
// String xml = x.toXML(obj);
// return xml;
final XMLEncoder e = new XMLEncoder(out);
e.setExceptionListener(new XmlEncoderExceptionListener());
// e.setPersistenceDelegate(Object.class, new MyPersistenceDelegate());
e.writeObject(obj);
e.close();
return out.toString();
// return null;
}
JKObjectUtil.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:jk-util
作者:
评论列表
文章目录