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












JavaBean













測試類 解析xml 反序列化到j(luò)avaBean object


















二: 注解方式
xml:













javaBean

















測試



















POM.xml











|
||||||||||||||||||||||||||||||||||
xstream 解析xml 別名 注解 list集合 boolean 數(shù)組 converter Pom.xml設(shè)置Posted on 2012-01-31 17:59 云云 閱讀(16940) 評論(3) 編輯 收藏![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() JavaBean ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 測試類 解析xml 反序列化到j(luò)avaBean object ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 二: 注解方式 xml: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() javaBean ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 測試 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() POM.xml ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 評論# re: xstream 解析xml 別名 注解 list集合 boolean 數(shù)組 converter Pom.xml設(shè)置 回復(fù) 更多評論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類型的數(shù)組,我把它添加到一個list里面,想通過xstream遍歷成xml。(源代碼: ArrayList list = new ArrayList(); list.add("CALCULATE"); list.add("caihongcheng"); list.add(10); list.add(status);//status為boolean數(shù)組 ) 求大神給寫段代碼讓上面的數(shù)組變成下面那樣的,可以把代碼發(fā)給我郵箱: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 數(shù)組 converter Pom.xml設(shè)置[未登錄] 回復(fù) 更多評論2014-12-29 14:18 by xiaoxiao謝謝分享!幫我解決了隱式集合的問題!
# re: xstream 解析xml 別名 注解 list集合 boolean 數(shù)組 converter Pom.xml設(shè)置 回復(fù) 更多評論2016-03-26 17:06 by lzk非常感謝!
|
||||||||||||||||||||||||||||||||||