Node Director
Static Public Member Functions | List of all members
org.json.CookieList Class Reference

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

Static Public Member Functions

static JSONObject toJSONObject (String string) throws ParseException
 Convert a cookie list into a JSONObject.
static String toString (JSONObject o)
 Convert a JSONObject into a cookie list.

Detailed Description

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

Author
JSON.org
Version
0.1

Member Function Documentation

static JSONObject org.json.CookieList.toJSONObject ( String  string) throws ParseException
static

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"));

Parameters
stringA cookie list string
Returns
A JSONObject
Exceptions
ParseException

References org.json.JSONTokener.more(), org.json.JSONTokener.next(), org.json.JSONTokener.nextTo(), org.json.JSONObject.put(), and org.json.JSONTokener.unescape().

Referenced by org.json.Test.main().

static String org.json.CookieList.toString ( JSONObject  o)
static

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".

Parameters
oA JSONObject
Returns
A cookie list string

References org.json.Cookie.escape(), org.json.JSONObject.getString(), org.json.JSONObject.isNull(), and org.json.JSONObject.keys().

Referenced by org.json.Test.main().


The documentation for this class was generated from the following file: