|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.minidev.json.JSONValue
public class JSONValue
JSONValue is the helper class In most of case you should use those static
methode to user JSON-smart
The most commonly use methode are parse(String)
toJSONString(Object)
Field Summary | |
---|---|
static JSONStyle |
COMPRESSION
Global default compression type |
Constructor Summary | |
---|---|
JSONValue()
|
Method Summary | |
---|---|
static String |
compress(String s)
Compress Json input keeping element order |
static String |
compress(String input,
JSONStyle style)
Reformat Json input keeping element order |
static String |
escape(String s)
|
static void |
escape(String s,
Appendable ap)
|
static void |
escape(String s,
Appendable ap,
JSONStyle compression)
|
static String |
escape(String s,
JSONStyle compression)
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F). |
static boolean |
isValidJson(Reader in)
Check Json Syntax from input Reader |
static boolean |
isValidJson(String s)
Check Json Syntax from input String |
static boolean |
isValidJsonStrict(Reader in)
Check RFC4627 Json Syntax from input Reader |
static boolean |
isValidJsonStrict(String s)
check RFC4627 Json Syntax from input String |
static Object |
parse(byte[] in)
Parse JSON text into java object from the input source. |
static Object |
parse(InputStream in)
Parse JSON text into java object from the input source. |
static Object |
parse(Reader in)
Parse JSON text into java object from the input source. |
static Object |
parse(String s)
Parse JSON text into java object from the input source. |
static Object |
parseKeepingOrder(byte[] in)
Parse Json input to a java Object keeping element order |
static Object |
parseKeepingOrder(InputStream in)
Parse Json input to a java Object keeping element order |
static Object |
parseKeepingOrder(Reader in)
Parse Json input to a java Object keeping element order |
static Object |
parseKeepingOrder(String in)
Parse Json input to a java Object keeping element order |
static Object |
parseStrict(byte[] s)
Parse valid RFC4627 JSON text into java object from the input source. |
static Object |
parseStrict(InputStream in)
Parse valid RFC4627 JSON text into java object from the input source. |
static Object |
parseStrict(Reader in)
Parse valid RFC4627 JSON text into java object from the input source. |
static Object |
parseStrict(String s)
Parse valid RFC4627 JSON text into java object from the input source. |
static Object |
parseWithException(byte[] in)
Parse JSON text into java object from the input source. |
static Object |
parseWithException(InputStream in)
Parse JSON text into java object from the input source. |
static Object |
parseWithException(Reader in)
Parse JSON text into java object from the input source. |
static Object |
parseWithException(String s)
Parse JSON text into java object from the input source. |
static void |
SAXParse(InputStream input,
ContentHandler handler)
Parse Json Using SAX event handler |
static void |
SAXParse(Reader input,
ContentHandler handler)
Parse Json Using SAX event handler |
static void |
SAXParse(String input,
ContentHandler handler)
Parse Json Using SAX event handler |
static String |
toJSONString(Object value)
Encode an object into JSON text and write it to out. |
static String |
toJSONString(Object value,
JSONStyle compression)
Convert an object to JSON text. |
static String |
uncompress(String s)
Compress Json input keeping element order |
static void |
writeJSONString(Object value,
Appendable out)
Encode an object into JSON text and write it to out. |
static void |
writeJSONString(Object value,
Appendable out,
JSONStyle compression)
Encode an object into JSON text and write it to out. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static JSONStyle COMPRESSION
Constructor Detail |
---|
public JSONValue()
Method Detail |
---|
public static Object parse(byte[] in)
JSONParser.parse(Reader)
,
parseWithException(Reader)
public static Object parse(InputStream in)
JSONParser.parse(Reader)
,
parseWithException(Reader)
public static Object parse(Reader in)
JSONParser.parse(Reader)
,
parseWithException(Reader)
public static Object parse(String s)
JSONParser.parse(String)
,
parseWithException(String)
public static Object parseKeepingOrder(byte[] in)
public static Object parseKeepingOrder(InputStream in)
public static Object parseKeepingOrder(Reader in)
public static Object parseKeepingOrder(String in)
public static void SAXParse(InputStream input, ContentHandler handler) throws ParseException, IOException
ParseException
IOException
public static void SAXParse(Reader input, ContentHandler handler) throws ParseException, IOException
ParseException
IOException
public static void SAXParse(String input, ContentHandler handler) throws ParseException
ParseException
public static String compress(String input, JSONStyle style)
public static String compress(String s)
public static String uncompress(String s)
public static Object parseWithException(byte[] in) throws IOException, ParseException
IOException
ParseException
JSONParser
public static Object parseWithException(InputStream in) throws IOException, ParseException
IOException
ParseException
JSONParser
public static Object parseWithException(Reader in) throws IOException, ParseException
IOException
ParseException
JSONParser
public static Object parseWithException(String s) throws ParseException
ParseException
JSONParser
public static Object parseStrict(InputStream in) throws IOException, ParseException
IOException
ParseException
JSONParser
public static Object parseStrict(Reader in) throws IOException, ParseException
IOException
ParseException
JSONParser
public static Object parseStrict(String s) throws ParseException
ParseException
JSONParser
public static Object parseStrict(byte[] s) throws ParseException
ParseException
JSONParser
public static boolean isValidJsonStrict(Reader in) throws IOException
IOException
public static boolean isValidJsonStrict(String s)
public static boolean isValidJson(Reader in) throws IOException
IOException
public static boolean isValidJson(String s)
public static void writeJSONString(Object value, Appendable out) throws IOException
If this object is a Map or a List, and it's also a JSONStreamAware or a JSONAware, JSONStreamAware or JSONAware will be considered firstly.
IOException
JSONObject.writeJSON(Map, Appendable)
,
JSONArray.writeJSONString(List, Appendable)
public static void writeJSONString(Object value, Appendable out, JSONStyle compression) throws IOException
If this object is a Map or a List, and it's also a JSONStreamAware or a JSONAware, JSONStreamAware or JSONAware will be considered firstly.
IOException
JSONObject.writeJSON(Map, Appendable)
,
JSONArray.writeJSONString(List, Appendable)
public static String toJSONString(Object value)
If this object is a Map or a List, and it's also a JSONStreamAware or a JSONAware, JSONStreamAware or JSONAware will be considered firstly.
JSONObject.writeJSON(Map, Appendable)
,
JSONArray.writeJSONString(List, Appendable)
public static String toJSONString(Object value, JSONStyle compression)
If this object is a Map or a List, and it's also a JSONAware, JSONAware will be considered firstly.
DO NOT call this method from toJSONString() of a class that implements both JSONAware and Map or List with "this" as the parameter, use JSONObject.toJSONString(Map) or JSONArray.toJSONString(List) instead.
JSONObject.toJSONString(Map)
,
JSONArray.toJSONString(List)
public static String escape(String s)
public static String escape(String s, JSONStyle compression)
public static void escape(String s, Appendable ap)
public static void escape(String s, Appendable ap, JSONStyle compression)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |