/**
* Serialize all the EventData items into an XML representation.
*
* @param map the Map to transform
* @return an XML String containing all the EventDAta items.
*/
public static String toXML(Map<String, Object> map) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
XMLEncoder encoder = new XMLEncoder(baos);
encoder.setExceptionListener(new ExceptionListener() {
public void exceptionThrown(Exception exception) {
exception.printStackTrace();
}
});
encoder.writeObject(map);
encoder.close();
return baos.toString();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
EventData.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:bartleby
作者:
评论列表
文章目录