1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 16:00:51 -07:00
This commit is contained in:
Douglas Crockford 2010-12-23 12:39:11 -08:00
parent 667813de3c
commit 68de4feaec
2 changed files with 55 additions and 59 deletions

View file

@ -197,9 +197,7 @@ public class JSONObject {
key = x.nextValue().toString(); key = x.nextValue().toString();
} }
/* // The key is followed by ':'. We will also tolerate '=' or '=>'.
* The key is followed by ':'. We will also tolerate '=' or '=>'.
*/
c = x.nextClean(); c = x.nextClean();
if (c == '=') { if (c == '=') {
@ -211,9 +209,7 @@ public class JSONObject {
} }
putOnce(key, x.nextValue()); putOnce(key, x.nextValue());
/* // Pairs are separated by ','. We will also tolerate ';'.
* Pairs are separated by ','. We will also tolerate ';'.
*/
switch (x.nextClean()) { switch (x.nextClean()) {
case ';': case ';':
@ -1230,7 +1226,7 @@ public class JSONObject {
* @param s A String. * @param s A String.
* @return A simple JSON value. * @return A simple JSON value.
*/ */
static public Object stringToValue(String s) { public static Object stringToValue(String s) {
if (s.equals("")) { if (s.equals("")) {
return s; return s;
} }

10
README
View file

@ -25,15 +25,15 @@ The package compiles on Java 1.2 thru Java 1.4.
JSONObject.java: The JSONObject can parse text from a String or a JSONTokener JSONObject.java: The JSONObject can parse text from a String or a JSONTokener
to produce a map-like object. The object provides methods of manipulating its to produce a map-like object. The object provides methods for manipulating its
contents, and for producing a JSON compliant serialization. contents, and for producing a JSON compliant object serialization.
JSONArray.java: The JSONObject can parse text from a String or a JSONTokener JSONArray.java: The JSONObject can parse text from a String or a JSONTokener
to produce a vector-like object. The object provides methods of manipulating to produce a vector-like object. The object provides methods for manipulating
its contents, and for producing a JSON compliant serialization. its contents, and for producing a JSON compliant array serialization.
JSONTokenizer.java: The JSONTokener breaks a text into a sequence of individual JSONTokenizer.java: The JSONTokener breaks a text into a sequence of individual
tokens. It can be constructed from a String,Reader, or InputStream. tokens. It can be constructed from a String, Reader, or InputStream.
JSONException.java: The JSONException is the standard exception type thrown JSONException.java: The JSONException is the standard exception type thrown
by this package. by this package.