InputStream inputStream;
try {
inputStream = getResources().getAssets().open("jsonAddressData");
String dataContent = convertStreamToString(inputStream);
ObjectMapper mObjectMapper=new ObjectMapper();
Map<String , Object> maps = mObjectMapper.readValue(dataContent, Map.class);
mAddressAdapter = new AddressAdapter((List<Map<String, Object>>) maps.get("selNoLeaseContractReason"), AddressActivity.this);
mListView.setAdapter(mAddressAdapter);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
/**
* 输入流转字符串
* @param is
* @return
*/
public String convertStreamToString(InputStream is) {
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return sb.toString();
}
{
"mobilePhone": "13085325505",
"agreeToLicense": "1",
"createdAt": "2015-06-01 14:30:53",
"updatedAt": "2015-06-03 14:30:49",
"openId": "fdsafas8789KJKD99",
"isEmailVerified": "1",
"renewTime":"2015-06-03 14:30:49",
"objectId": "2388",
"applicationId": "4050",
"isRenewable": "0",
"industryGId": "2",
"industryGName": "餐饮、娱乐类",
"industryPId": "101001",
"industryPName": "餐饮类",
"industryCId": "235010",
"industryCName": "女性用品商店",
"provinceId": "24",
"cityId": "215",
"bizRegisterNo": "12313221321312",
"businessAddress": "北张家浜路",
"corporateName":"企业名称",
"businessName":"经营名称",
"bizAddrLonlat": "123.123192,139.32839232",
"ownerAddress": "北张家浜路",
"landlordPhone": "13728338271",
"emergencyName": "张三",
"emergencyPhone": "13782293002",
"directType": "父母",
"directName": "李四",
"directPhone": "13822273364",
"longitude": "123.4857344",
"latitude": "142.1232391213",
"isJxlValid": "0",
"secondaryBankDDA": "312039228172",
"secondaryBankName": "上海银行",
"loanAmount": "70000",
"hasLeaseContract": "1",
"landlordPhone": "13001131723",
"noLeaseContractReason": "1",
"proprietorName": "业主",
"proprietorPhone": "13001131722",
"leaseContractStartTime": "2014-01-02 00:00:00",
"leaseContractEndTime": "2015-01-12 00:00:00",
"leaseYearAmt": "10000",
"numLocations": "8",
"yearTurnover": "12000",
"planFundTerm": "6",
"planFundTermName": "六个月 月费率1.5%",
"proposerName": "法定代表人 哈哈",
"isBasicCreditValid": "1",
"isPosCreditValid": "1",
"qrcodeUrl":"http://localhost/corp/appdocs/2015/09/11/app/6723_qrcode.png",
"selHasLeaseContract": [
{
"id": 0,
"title": "无"
},
{
"id": 1,
"title": "有"
}
],
<span style="color:#cc0000;">"selNoLeaseContractReason": [
{
"id": 1,
"title": "自有房产"
},
{
"id": 2,
"title": "无偿使用"
},
{
"id": 3,
"title": "合同丢失"
}
]
}
jackson-all-1.9.2.jar