Package org.jooq.tools.json
Class JSONValue
- java.lang.Object
-
- org.jooq.tools.json.JSONValue
-
public class JSONValue extends java.lang.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 java.lang.Stringescape(java.lang.String s)Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).static java.lang.ObjectparseWithException(java.io.Reader in)Parse JSON text into java object from the input source.static java.lang.ObjectparseWithException(java.lang.String s)static java.lang.StringtoJSONString(java.lang.Object value)Convert an object to JSON text.static voidwriteJSONString(java.lang.Object value, java.io.Writer out)Encode an object into JSON text and write it to out.
-
-
-
Method Detail
-
writeJSONString
public static void writeJSONString(java.lang.Object value, java.io.Writer out) throws java.io.IOExceptionEncode an object into JSON text and write it to out.- Throws:
java.io.IOException- See Also:
JSONObject.writeJSONString(Map, Writer),JSONArray.writeJSONString(List, Writer)
-
toJSONString
public static java.lang.String toJSONString(java.lang.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 java.lang.String escape(java.lang.String s)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
-
parseWithException
public static java.lang.Object parseWithException(java.io.Reader in) throws java.io.IOException, ParseExceptionParse 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:
java.io.IOExceptionParseException
-
parseWithException
public static java.lang.Object parseWithException(java.lang.String s) throws ParseException- Throws:
ParseException
-
-