Convert a String of JSONArray text into object form.
@param str The JSONArray string to parse into a Java Object.
@return The contructed JSONArray Object.

@throws IOEXception Thrown if malformed JSON is read,
775919
static public JSONArray parse(String str) throws IOException {
        StringReader strReader = new StringReader(str);
        return parse(strReader);
    }
566824
public void writeUTFAsArray(String str) throws IOException {
		byte[] buffer = str.getBytes("UTF-8");
		super.writeInt(buffer.length);
		super.write(buffer, 0, buffer.length);
	}
459701
public T parse(String jsonString) throws IOException {
        JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(jsonString);
        jsonParser.nextToken();
        return parse(jsonParser);
    }
588776
public static <E> E parse(String jsonString, Class<E> jsonObjectClass) throws IOException {
        return mapperFor(jsonObjectClass).parse(jsonString);
    }
1098138
function parseString(str) {
  var obj = {};
  var pairs = str.split('&');
  var pair;
  var pos;

  for (var i = 0, len = pairs.length; i < len; ++i) {
    pair = pairs[i];
    pos = pair.indexOf('=');
    if (pos == -1) {
      obj[decodeURIComponent(pair)] = '';
    } else {
      obj[decodeURIComponent(pair.slice(0, pos))] =
        decodeURIComponent(pair.slice(pos + 1));
    }
  }

  return obj;
}
1242014
public static String encode(final String str) {
        try {
            return URLEncoder.encode(str, "UTF-8");
        } catch (final Exception e) {
            LOGGER.log(Level.WARN, "Encodes str [" + str + "] failed", e);

            return str;
        }
    }
812721
private String convertToString(JsonNode jsonArrayNode) {

		StringBuilder strBuilder = new StringBuilder();
		Iterator<JsonNode> nodeIterator = jsonArrayNode.iterator();
		while (nodeIterator.hasNext()) {
			JsonNode jsonNode = (JsonNode) nodeIterator.next();
			strBuilder.append(jsonNode.asText());
			if (nodeIterator.hasNext()) {
				strBuilder.append(ARRAY_VALUE_SEPARATOR);
			}
		}
		return strBuilder.toString();
	}
992944
function (str) {
    str = str.replace(/\s/g,'');
    if (!str.match(/^\{.*\}$/)) {
      throw new sjcl.exception.invalid("json decode: this isn't json!");
    }
    var a = str.replace(/^\{|\}$/g, '').split(/,/), out={}, i, m;
    for (i=0; i<a.length; i++) {
      if (!(m=a[i].match(/^\s*(?:(["']?)([a-z][a-z0-9]*)\1)\s*:\s*(?:(-?\d+)|"([a-z0-9+\/%*_.@=\-]*)"|(true|false))$/i))) {
        throw new sjcl.exception.invalid("json decode: this isn't json!");
      }
      if (m[3]) {
        out[m[2]] = parseInt(m[3],10);
      } else if (m[4]) {
        out[m[2]] = m[2].match(/^(ct|adata|salt|iv)$/) ? sjcl.codec.base64.toBits(m[4]) : unescape(m[4]);
      } else if (m[5]) {
        out[m[2]] = m[5] === 'true';
      }
    }
    return out;
  }
1059507
public static JSONValue parse(String jsonString) throws JSONException {
		if (jsonString == null || "".equals(jsonString)) {
			return JSONNull.getInstance();
		}
		if (jsonString.charAt(0) == '[') {
			return new JSONArray(eval(jsonString));
		}
		return new JSONObject(eval(jsonString));
	}
650658
public static String decode(String str) {
    if (str!=null) {
      try {
        StringBuilder sb = new StringBuilder();
        for (int idx = str.toLowerCase().indexOf("%2f"); idx>=0; idx = str.toLowerCase().indexOf("%2f")) {
          sb.append(java.net.URLDecoder.decode(str.substring(0, idx),"UTF-8")).append(str.substring(idx, idx+3));
          str = str.substring(idx+3);
        }
        sb.append(java.net.URLDecoder.decode(str,"UTF-8"));
        str = sb.toString();
      } catch (Exception ex) {
      }
    }
    return str;
  }
171059
public static AbstractType<?> parse(String str) throws SyntaxException, ConfigurationException
    {
        if (str == null)
            return BytesType.instance;

        AbstractType<?> type = cache.get(str);

        if (type != null)
            return type;

        // This could be simplier (i.e. new TypeParser(str).parse()) but we avoid creating a TypeParser object if not really necessary.
        int i = 0;
        i = skipBlank(str, i);
        int j = i;
        while (!isEOS(str, i) && isIdentifierChar(str.charAt(i)))
            ++i;

        if (i == j)
            return BytesType.instance;

        String name = str.substring(j, i);
        i = skipBlank(str, i);

        if (!isEOS(str, i) && str.charAt(i) == '(')
            type = getAbstractType(name, new TypeParser(str, i));
        else
            type = getAbstractType(name);

        // We don't really care about concurrency here. Worst case scenario, we do some parsing unnecessarily
        cache.put(str, type);
        return type;
    }
569210
public static JsonArray fromParser(JsonPullParser parser) throws IOException,
			JsonFormatException {
		State state = parser.getEventType();

		if (state == State.VALUE_NULL) {
			return null;
		} else if (state != State.START_ARRAY) {
			throw new JsonFormatException("unexpected token. token=" + state, parser);
		}

		JsonArray jsonArray = new JsonArray();
		while ((state = parser.lookAhead()) != State.END_ARRAY) {
			jsonArray.add(getValue(parser), state);
		}
		parser.getEventType();

		return jsonArray;
	}
1230139
public static <T> T deserialize(String str) {
        if (StringUtils.isEmpty(str)) {
            return null;
        }
        ByteArrayInputStream bis = null;
        ObjectInputStream ois = null;
        try {
            Base64.Decoder decoder = Base64.getDecoder();
            bis = new ByteArrayInputStream(
                    decoder.decode(str));
            ois = new ObjectInputStream(bis);
            return (T) ois.readObject();
        } catch (Exception e) {
            throw new RuntimeException("deserialize session error", e);
        } finally {
            CommonUtils.closeIOStream(bis, null);
            CommonUtils.closeIOStream(ois, null);
        }
    }
111639
public static JSONFunction parse( String str ) {
      if( !JSONUtils.isFunction( str ) ) {
         throw new JSONException( "String is not a function. " + str );
      } else {
         String params = JSONUtils.getFunctionParams( str );
         String text = JSONUtils.getFunctionBody( str );
         return new JSONFunction( (params != null) ? StringUtils.split( params, "," ) : null, text != null ? text : "" );
      }
   }
535577
public static boolean isJsonObj(String str) {
		if (StrUtil.isBlank(str)) {
			return false;
		}
		return StrUtil.isWrap(str.trim(), '{', '}');
	}
994905
private final String bufferToString(byte[] str) {
		String string = null;
		if (str != null) {
			string = AMF.CHARSET.decode(ByteBuffer.wrap(str)).toString();
			log.debug("String: {}", string);
		} else {
			log.warn("ByteBuffer was null attempting to read String");
		}
		return string;
	}
582561
public static Object deserialize(String str) throws IOException, ClassNotFoundException, CoderException {
	ByteArrayInputStream bais = new ByteArrayInputStream(Base64Coder.decode(str));
	return deserialize(bais);
    }