如何反序列化下列代码到一个类对象?
cat列的孩子对象是不定的,就是说可能出现很多的属性,并且名字都不一样
所以我想把它发序列化到一个键值对对象中如何做到呢?
谢谢!
<lst name="facet_counts">
<lst name="facet_queries" />
- <lst name="facet_fields">
- <lst name="cat">
<int name="search">1</int>
<int name="software">1</int>
<int name="camera">0</int>
<int name="card">0</int>
<int name="connector">0</int>
<int name="copier">0</int>
<int name="drive">0</int>
</lst>
</lst>
<lst name="facet_dates" />
</lst>
</response>
cat列的孩子对象是不定的,就是说可能出现很多的属性,并且名字都不一样
所以我想把它发序列化到一个键值对对象中如何做到呢?
谢谢!
<lst name="facet_counts">
<lst name="facet_queries" />
- <lst name="facet_fields">
- <lst name="cat">
<int name="search">1</int>
<int name="software">1</int>
<int name="camera">0</int>
<int name="card">0</int>
<int name="connector">0</int>
<int name="copier">0</int>
<int name="drive">0</int>
</lst>
</lst>
<lst name="facet_dates" />
</lst>
</response>
"responseHeader":{
"status":0,
"QTime":0,
"params":{
"facet":"true",
"indent":"on",
"start":"0",
"q":"solr",
"facet.field":"cat",
"wt":"json",
"rows":"10",
"version":"2.2"}},
"response":{"numFound":1,"start":0,"docs":[
{
"id":"SOLR1000",
"name":"Solr, the Enterprise Search Server",
"manu":"Apache Software Foundation",
"price":0.0,
"popularity":10,
"inStock":true,
"incubationdate_dt":"2006-01-17T00:00:00Z",
"cat":[
"software",
"search"],
"features":[
"Advanced Full-Text Search Capabilities using Lucene",
"Optimized for High Volume Web Traffic",
"Standards Based Open Interfaces - XML and HTTP",
"Comprehensive HTML Administration Interfaces",
"Scalability - Efficient Replication to other Solr Search Servers",
"Flexible and Adaptable with XML configuration and Schema",
"Good unicode support: héllo (hello with an accent over the e)"]}]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{
"cat":[
"search",1,
"software",1,
"camera",0,
"card",0,
"connector",0,
"copier",0,
"drive",0,
"electronics",0,
"graphics",0,
"hard",0,
"memory",0,
"monitor",0,
"multifunction",0,
"music",0,
"printer",0,
"scanner",0]},
"facet_dates":{}}}