|
|
@ -20,8 +20,10 @@ import java.util.Map; |
|
|
|
* @author qi |
|
|
|
* @author qi |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class MessageUtil { |
|
|
|
public class MessageUtil { |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 默认字符编辑 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static final String DEFAULT_ENCODING="utf8"; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* xml 转 map对象 |
|
|
|
* xml 转 map对象 |
|
|
@ -50,7 +52,7 @@ public class MessageUtil { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static String MessageToXml(Object obj){ |
|
|
|
public static String MessageToXml(Object obj){ |
|
|
|
XStream xstream = new XStream(new DomDriver("utf8")); |
|
|
|
XStream xstream = new XStream(new DomDriver(DEFAULT_ENCODING)); |
|
|
|
// 识别obj类中的注解
|
|
|
|
// 识别obj类中的注解
|
|
|
|
xstream.processAnnotations(obj.getClass()); |
|
|
|
xstream.processAnnotations(obj.getClass()); |
|
|
|
/* |
|
|
|
/* |
|
|
|