<
member_bankcard_querylist_response
>
<
list
>
<
bank_code
>6222023202033815035</
bank_code
>
<
status
>未审核</
status
>
</
list
>
<
success
>true</
success
>
<
sign
>8B9EEE0911F8CDC965D025911691E779</
sign
>
</
member_bankcard_querylist_response
>
<
member_bankcard_querylist_response
>
<
list
>
<
bank_code
>6222023202033815035</
bank_code
>
<
status
>未审核</
status
>
</
list
>
<
list
>
<
bank_code
>6222023202033815035</
bank_code
>
<
status
>未审核</
status
>
</
list
>
<
success
>true</
success
>
<
sign
>8B9EEE0911F8CDC965D025911691E779</
sign
>
</
member_bankcard_querylist_response
>
if
(clazz.compareToIgnoreCase(JSONTypes.LIST) ==
0
) {
if
(!jsonObject.has(key)) {
jsonObject.element(key,
new
JSONArray()
.element(simplifyValue(
jsonObject,
processObjectElement(element,
defaultType))));
((JSONArray) jsonObject.get(key)).setExpandElements(
true
);
classProcessed =
true
;
}
}
<
member_bankcard_querylist_response
>
<
list
class="list"
>
<
bank_code
>6222023202033815035</
bank_code
>
<
status
>未审核</
status
>
</
list
>
<
success
>true</
success
>
<
sign
>8B9EEE0911F8CDC965D025911691E779</
sign
>
</
member_bankcard_querylist_response
>
import
java.io.Serializable;
import
javax.xml.bind.annotation.XmlAttribute;
import
javax.xml.bind.annotation.XmlRootElement;
/**
* 返回xml描述改对象为List ,在json-lib转义的时候发现list.size() == 1 的时候改回Array
* @author JueYue
* @date 2015年4月23日 下午4:39:48
*/
@XmlRootElement
public
class
XmlListBase
implements
Serializable {
private
static
final
long
serialVersionUID = 1L;
private
String beanType =
"list"
;
@XmlAttribute
(name =
"class"
)
public
String getBeanType() {
return
beanType;
}
public
void
setBeanType(String beanType) {
this
.beanType = beanType;
}
}
原文地址:http://blog.csdn.net/qjueyue/article/details/45228863