mirror of
https://github.com/fangyidong/json-simple.git
synced 2025-12-07 16:00:52 +03:00
Marked a pair of parse methods as deprecated.
This commit is contained in:
@@ -36,6 +36,9 @@ public class JSONValue {
|
|||||||
* java.lang.Boolean,
|
* java.lang.Boolean,
|
||||||
* null
|
* 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){
|
public static Object parse(Reader in){
|
||||||
try{
|
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){
|
public static Object parse(String s){
|
||||||
StringReader in=new StringReader(s);
|
StringReader in=new StringReader(s);
|
||||||
return parse(in);
|
return parse(in);
|
||||||
|
|||||||
Reference in New Issue
Block a user