code: private static String getValue(JSONTokener x) throws JSONException {
  
          char c;
          do {
              c = x.next();
          } while ((c == ' ') || (c == '\t'));
          switch (c) {
              case 0:
                  return null;
              case '"':
              case '\'':
                  return x.nextString(c);
              case ',':
                  x.back();
                  return "";
              default:
                  x.back();
                  return x.nextTo(',');
          }
      }
docs: Get the next value. The value can be wrapped in quotes. The value can
  be empty.<p>
  
  @param x A JSONTokener of the source text
  @return The value string, or null if empty
  @throws JSONException if the quoted string is badly formed