zoukankan      html  css  js  c++  java
  • android json解析

    直接上源码:

    package com.m.billingplug.util;
    
    import org.json.JSONObject;
    
    /**
     * json管理类
     * @author mhx
     *
     */
    public class JsonUtil {
    
        /**
         * 解析json对象
         * @param jsonObject json对象
         * @param key json key 
         * @return 返回json值
         */
        public static String paresJSON(JSONObject jsonObject, String key) {
            try {
                
                if(null == jsonObject) {
                    return "";
                }
                Object obj = jsonObject.opt(key);
                if(obj == null) {
                    return "";
                }
                else 
                    return obj.toString();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return "";
        }
    }
  • 相关阅读:
    C++中类模板的概念和意义
    欢迎访问新博客aiyoupass.com
    P2327
    P2885
    P1968
    Link-Cut-Tree
    树的重心
    点分治笔记
    SPOJ 375
    树链剖分
  • 原文地址:https://www.cnblogs.com/code4app/p/3759006.html
Copyright © 2011-2022 走看看