public class JSONParser extends Object
Constructor and Description |
---|
JSONParser(String jsonText)
Construct a JSONParser from a string.
|
Modifier and Type | Method and Description |
---|---|
org.apache.sling.commons.json.JSONObject |
parse(String key)
Parse the JSON code passed to the constructor to find the given key.
|
public JSONParser(String jsonText) throws org.apache.sling.commons.json.JSONException
jsonText
- A string which contains a JSON code. String representation of
a JSON code.org.apache.sling.commons.json.JSONException
- If there is a syntax error in the source string.public org.apache.sling.commons.json.JSONObject parse(String key) throws org.apache.sling.commons.json.JSONException
key
- The key whose value is searched for.org.apache.sling.commons.json.JSONException
- If the key is not found.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.