yt4droid.internal.org.json
クラス CDL

java.lang.Object
  上位を拡張 yt4droid.internal.org.json.CDL

public class CDL
extends java.lang.Object

This provides static methods to convert comma delimited text into a JSONArray, and to covert a JSONArray into comma delimited text. Comma delimited text is a very popular format for data interchange. It is understood by most database, spreadsheet, and organizer programs.

Each row of text represents a row in a table or a data record. Each row ends with a NEWLINE character. Each row contains one or more values. Values are separated by commas. A value can contain any character except for comma, unless is is wrapped in single quotes or double quotes.

The first row usually contains the names of the columns.

A comma delimited list can be converted into a JSONArray of JSONObjects. The names for the elements in the JSONObjects can be taken from the names in the first row.

バージョン:
2010-12-24
作成者:
JSON.org

コンストラクタの概要
CDL()
           
 
メソッドの概要
static JSONArray rowToJSONArray(JSONTokener x)
          Produce a JSONArray of strings from a row of comma delimited values.
static JSONObject rowToJSONObject(JSONArray names, JSONTokener x)
          Produce a JSONObject from a row of comma delimited text, using a parallel JSONArray of strings to provides the names of the elements.
static java.lang.String rowToString(JSONArray ja)
          Produce a comma delimited text row from a JSONArray.
static JSONArray toJSONArray(JSONArray names, JSONTokener x)
          Produce a JSONArray of JSONObjects from a comma delimited text string using a supplied JSONArray as the source of element names.
static JSONArray toJSONArray(JSONArray names, java.lang.String string)
          Produce a JSONArray of JSONObjects from a comma delimited text string using a supplied JSONArray as the source of element names.
static JSONArray toJSONArray(JSONTokener x)
          Produce a JSONArray of JSONObjects from a comma delimited text string, using the first row as a source of names.
static JSONArray toJSONArray(java.lang.String string)
          Produce a JSONArray of JSONObjects from a comma delimited text string, using the first row as a source of names.
static java.lang.String toString(JSONArray ja)
          Produce a comma delimited text from a JSONArray of JSONObjects.
static java.lang.String toString(JSONArray names, JSONArray ja)
          Produce a comma delimited text from a JSONArray of JSONObjects using a provided list of names.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

CDL

public CDL()
メソッドの詳細

rowToJSONArray

public static JSONArray rowToJSONArray(JSONTokener x)
                                throws JSONException
Produce a JSONArray of strings from a row of comma delimited values.

パラメータ:
x - A JSONTokener of the source text.
戻り値:
A JSONArray of strings.
例外:
JSONException

rowToJSONObject

public static JSONObject rowToJSONObject(JSONArray names,
                                         JSONTokener x)
                                  throws JSONException
Produce a JSONObject from a row of comma delimited text, using a parallel JSONArray of strings to provides the names of the elements.

パラメータ:
names - A JSONArray of names. This is commonly obtained from the first row of a comma delimited text file using the rowToJSONArray method.
x - A JSONTokener of the source text.
戻り値:
A JSONObject combining the names and values.
例外:
JSONException

rowToString

public static java.lang.String rowToString(JSONArray ja)
Produce a comma delimited text row from a JSONArray. Values containing the comma character will be quoted. Troublesome characters may be removed.

パラメータ:
ja - A JSONArray of strings.
戻り値:
A string ending in NEWLINE.

toJSONArray

public static JSONArray toJSONArray(java.lang.String string)
                             throws JSONException
Produce a JSONArray of JSONObjects from a comma delimited text string, using the first row as a source of names.

パラメータ:
string - The comma delimited text.
戻り値:
A JSONArray of JSONObjects.
例外:
JSONException

toJSONArray

public static JSONArray toJSONArray(JSONTokener x)
                             throws JSONException
Produce a JSONArray of JSONObjects from a comma delimited text string, using the first row as a source of names.

パラメータ:
x - The JSONTokener containing the comma delimited text.
戻り値:
A JSONArray of JSONObjects.
例外:
JSONException

toJSONArray

public static JSONArray toJSONArray(JSONArray names,
                                    java.lang.String string)
                             throws JSONException
Produce a JSONArray of JSONObjects from a comma delimited text string using a supplied JSONArray as the source of element names.

パラメータ:
names - A JSONArray of strings.
string - The comma delimited text.
戻り値:
A JSONArray of JSONObjects.
例外:
JSONException

toJSONArray

public static JSONArray toJSONArray(JSONArray names,
                                    JSONTokener x)
                             throws JSONException
Produce a JSONArray of JSONObjects from a comma delimited text string using a supplied JSONArray as the source of element names.

パラメータ:
names - A JSONArray of strings.
x - A JSONTokener of the source text.
戻り値:
A JSONArray of JSONObjects.
例外:
JSONException

toString

public static java.lang.String toString(JSONArray ja)
                                 throws JSONException
Produce a comma delimited text from a JSONArray of JSONObjects. The first row will be a list of names obtained by inspecting the first JSONObject.

パラメータ:
ja - A JSONArray of JSONObjects.
戻り値:
A comma delimited text.
例外:
JSONException

toString

public static java.lang.String toString(JSONArray names,
                                        JSONArray ja)
                                 throws JSONException
Produce a comma delimited text from a JSONArray of JSONObjects using a provided list of names. The list of names is not included in the output.

パラメータ:
names - A JSONArray of strings.
ja - A JSONArray of JSONObjects.
戻り値:
A comma delimited text.
例外:
JSONException