xstream 解析xml 別名 注解 list集合 boolean 數組 converter Pom.xml設置
Posted on 2012-01-31 17:59 云云 閱讀(16934) 評論(3) 編輯 收藏












JavaBean













測試類 解析xml 反序列化到javaBean object


















二: 注解方式
xml:













javaBean

















測試



















POM.xml











|
||||||||||||||||||||||||||||||||||
xstream 解析xml 別名 注解 list集合 boolean 數組 converter Pom.xml設置Posted on 2012-01-31 17:59 云云 閱讀(16934) 評論(3) 編輯 收藏![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() JavaBean ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 測試類 解析xml 反序列化到javaBean object ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 二: 注解方式 xml: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() javaBean ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 測試 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() POM.xml ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 評論# re: xstream 解析xml 別名 注解 list集合 boolean 數組 converter Pom.xml設置 回復 更多評論2013-03-27 17:30 by hello_kitty<list>
<string>CALCULATE</string> <string>caihongcheng</string> <int>10</int> <boolean-array> <boolean>true</boolean> <boolean>false</boolean> <boolean>false</boolean> <boolean>false</boolean> <boolean>false</boolean> <boolean>false</boolean> <boolean>false</boolean> <boolean>false</boolean> <boolean>false</boolean> <boolean>false</boolean> </boolean-array> </list> 一開始有一個boolean類型的數組,我把它添加到一個list里面,想通過xstream遍歷成xml。(源代碼: ArrayList list = new ArrayList(); list.add("CALCULATE"); list.add("caihongcheng"); list.add(10); list.add(status);//status為boolean數組 ) 求大神給寫段代碼讓上面的數組變成下面那樣的,可以把代碼發給我郵箱:513110286@qq.com,不勝感謝! <response> <command>CALCULATE</command> <parkName>caihongcheng</parkName> <picNumber>20</picNumber> <picValue>true</picValue> <picValue>false</picValue> <picValue>false</picValue> <picValue>false</picValue> <picValue>false</picValue> <picValue>false</picValue> <picValue>false</picValue> <picValue>false</picValue> <picValue>false</picValue> <picValue>false</picValue> </response> # re: xstream 解析xml 別名 注解 list集合 boolean 數組 converter Pom.xml設置[未登錄] 回復 更多評論2014-12-29 14:18 by xiaoxiao謝謝分享!幫我解決了隱式集合的問題!
非常感謝!
|
||||||||||||||||||||||||||||||||||