1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -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();
}
/*
* The key is followed by ':'. We will also tolerate '=' or '=>'.
*/
// The key is followed by ':'. We will also tolerate '=' or '=>'.
c = x.nextClean();
if (c == '=') {
@ -211,9 +209,7 @@ public class JSONObject {
}
putOnce(key, x.nextValue());
/*
* Pairs are separated by ','. We will also tolerate ';'.
*/
// Pairs are separated by ','. We will also tolerate ';'.
switch (x.nextClean()) {
case ';':
@ -1230,7 +1226,7 @@ public class JSONObject {
* @param s A String.
* @return A simple JSON value.
*/
static public Object stringToValue(String s) {
public static Object stringToValue(String s) {
if (s.equals("")) {
return s;
}

8
README
View file

@ -25,12 +25,12 @@ The package compiles on Java 1.2 thru Java 1.4.
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
contents, and for producing a JSON compliant serialization.
to produce a map-like object. The object provides methods for manipulating its
contents, and for producing a JSON compliant object serialization.
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
its contents, and for producing a JSON compliant serialization.
to produce a vector-like object. The object provides methods for manipulating
its contents, and for producing a JSON compliant array serialization.
JSONTokenizer.java: The JSONTokener breaks a text into a sequence of individual
tokens. It can be constructed from a String, Reader, or InputStream.