com.qq.connect.utils.json
类 CookieList

java.lang.Object
  继承者 com.qq.connect.utils.json.CookieList

public class CookieList
extends java.lang.Object

Convert a web browser cookie list string to a JSONObject and back.


构造方法摘要
CookieList()
           
 
方法摘要
static JSONObject toJSONObject(java.lang.String string)
          Convert a cookie list into a JSONObject.
static java.lang.String toString(JSONObject o)
          Convert a JSONObject into a cookie list.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

CookieList

public CookieList()
方法详细信息

toJSONObject

public static JSONObject toJSONObject(java.lang.String string)
                               throws JSONException
Convert a cookie list into a JSONObject. A cookie list is a sequence of name/value pairs. The names are separated from the values by '='. The pairs are separated by ';'. The names and the values will be unescaped, possibly converting '+' and '%' sequences. To add a cookie to a cooklist, cookielistJSONObject.put(cookieJSONObject.getString("name"), cookieJSONObject.getString("value"));

参数:
string - A cookie list string
返回:
A JSONObject
抛出:
JSONException

toString

public static java.lang.String toString(JSONObject o)
                                 throws JSONException
Convert a JSONObject into a cookie list. A cookie list is a sequence of name/value pairs. The names are separated from the values by '='. The pairs are separated by ';'. The characters '%', '+', '=', and ';' in the names and values are replaced by "%hh".

参数:
o - A JSONObject
返回:
A cookie list string
抛出:
JSONException