# re: xstream 解析xml 別名 注解 list集合 boolean 數組 converter Pom.xml設置 回復 更多評論
2013-03-27 17:30 by
<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>