- java.lang.Object
-
- org.jooq.tools.json.JSONValue
-
public class JSONValue extends Object
- Author:
- FangYidong<fangyidong@yahoo.com.cn>
-
-
Constructor Summary
Constructors Constructor Description JSONValue()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
escape(String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).static Object
parseWithException(Reader in)
Parse JSON text into java object from the input source.static Object
parseWithException(String s)
static String
toJSONString(Object value)
Convert an object to JSON text.static void
writeJSONString(Object value, Writer out)
Encode an object into JSON text and write it to out.
-
-
-
Method Detail
-
writeJSONString
public static void writeJSONString(Object value, Writer out) throws IOException
Encode an object into JSON text and write it to out.
-
toJSONString
public static String toJSONString(Object value)
Convert an object to JSON text.- Returns:
- JSON text, or "null" if value is null or it's an NaN or an INF number.
- See Also:
JSONObject.toJSONString(Map)
,JSONArray.toJSONString(List)
-
escape
public static String escape(String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
-
parseWithException
public static Object parseWithException(Reader in) throws IOException, ParseException
Parse JSON text into java object from the input source.- Returns:
- Instance of the following: org.json.simple.JSONObject, org.json.simple.JSONArray, java.lang.String, java.lang.Number, java.lang.Boolean, null
- Throws:
IOException
ParseException
-
parseWithException
public static Object parseWithException(String s) throws ParseException
- Throws:
ParseException
-
-