public class JsonUtil extends Object
| Constructor and Description |
|---|
JsonUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Object> |
fromJsonMap(String src) |
static boolean |
isNull(com.google.gson.JsonElement pElement)
判斷Json物件是否為null、JsonNull
|
static boolean |
isNullOrEmpty(com.google.gson.JsonElement pElement)
判斷Json物件是否為null、JsonNull或空值
|
static boolean |
isNullOrEmptyOrSpace(com.google.gson.JsonElement pElement)
判斷Json物件是否為null、JsonNull、空值或空格
|
static com.google.gson.JsonObject |
parseHttpResponseBody(org.apache.http.HttpResponse httpResponse,
String url) |
static com.google.gson.JsonElement |
toJsonTreeIgnoreNull(Object src) |
static String |
toString(Object src) |
static String |
toStringIgnoreNull(Object src) |
public static com.google.gson.JsonElement toJsonTreeIgnoreNull(Object src)
public static com.google.gson.JsonObject parseHttpResponseBody(org.apache.http.HttpResponse httpResponse,
String url)
throws org.apache.http.ParseException,
IOException,
JsonFormatException
org.apache.http.ParseExceptionIOExceptionJsonFormatExceptionpublic static boolean isNull(com.google.gson.JsonElement pElement)
pElement - 欲判斷之JsonElementpublic static boolean isNullOrEmpty(com.google.gson.JsonElement pElement)
pElement - 欲判斷之JsonElementpublic static boolean isNullOrEmptyOrSpace(com.google.gson.JsonElement pElement)
pElement - 欲判斷之JsonElementCopyright © 2023. All rights reserved.