diff --git a/src/main/java/org/json/simple/JSONValue.java b/src/main/java/org/json/simple/JSONValue.java index 8cf52d2..3658cfe 100644 --- a/src/main/java/org/json/simple/JSONValue.java +++ b/src/main/java/org/json/simple/JSONValue.java @@ -36,6 +36,9 @@ public class JSONValue { * java.lang.Boolean, * null * + * @deprecated this method may throw an {@code Error} instead of returning + * {@code null}; please use {@link JSONValue#parseWithException(Reader)} + * instead */ public static Object parse(Reader in){ try{ @@ -47,6 +50,26 @@ public class JSONValue { } } + /** + * Parse JSON text into java object from the given string. + * Please use parseWithException() if you don't want to ignore the exception. + * + * @see org.json.simple.parser.JSONParser#parse(Reader) + * @see #parseWithException(Reader) + * + * @param s + * @return Instance of the following: + * org.json.simple.JSONObject, + * org.json.simple.JSONArray, + * java.lang.String, + * java.lang.Number, + * java.lang.Boolean, + * null + * + * @deprecated this method may throw an {@code Error} instead of returning + * {@code null}; please use {@link JSONValue#parseWithException(String)} + * instead + */ public static Object parse(String s){ StringReader in=new StringReader(s); return parse(in);