Marked a pair of parse methods as deprecated.

This commit is contained in:
jon.chambers@gmail.com
2013-08-10 03:07:47 +00:00
parent e9e14319ab
commit 2d0898ad12

View File

@@ -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);