com.github.dakusui.symfonion.core
Class JsonUtil
java.lang.Object
com.github.dakusui.symfonion.core.JsonUtil
public class JsonUtil
- extends Object
|
Method Summary |
static boolean |
asBoolean(com.google.gson.JsonObject json,
Object... path)
|
static byte |
asByte(com.google.gson.JsonObject json,
Object... path)
|
static char |
asChar(com.google.gson.JsonObject json,
Object... path)
|
static char |
asCharWithDefaultValue(com.google.gson.JsonObject json,
char defaultValue,
Object... path)
|
static double |
asDouble(com.google.gson.JsonObject json,
Object... path)
|
static double |
asDoubleWithDefault(com.google.gson.JsonObject json,
double defaultValue,
Object... path)
|
static float |
asFloat(com.google.gson.JsonObject json,
Object... path)
|
static float |
asFloatWithDefault(com.google.gson.JsonObject json,
float defaultValue,
Object... path)
|
static int |
asInt(com.google.gson.JsonObject json,
Object... path)
|
static int |
asIntWithDefault(com.google.gson.JsonObject json,
int defaultValue,
Object... path)
|
static com.google.gson.JsonElement |
asJson(com.google.gson.JsonElement json,
Object... path)
|
static com.google.gson.JsonArray |
asJsonArray(com.google.gson.JsonObject json,
Object... path)
|
static com.google.gson.JsonObject |
asJsonObject(com.google.gson.JsonObject json,
Object... path)
|
static long |
asLong(com.google.gson.JsonObject json,
Object... path)
|
static String |
asString(com.google.gson.JsonObject json,
Object... path)
|
static String |
asStringWithDefault(com.google.gson.JsonObject json,
String defaultValue,
Object... path)
|
static boolean |
hasPath(com.google.gson.JsonObject json,
Object... path)
|
static Iterator<String> |
keyIterator(com.google.gson.JsonObject json)
|
static void |
main(String[] args)
|
static com.google.gson.JsonElement |
merge(com.google.gson.JsonElement a,
com.google.gson.JsonElement b)
|
static com.google.gson.JsonElement |
toJson(String str)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JsonUtil
public JsonUtil()
asBoolean
public static boolean asBoolean(com.google.gson.JsonObject json,
Object... path)
asByte
public static byte asByte(com.google.gson.JsonObject json,
Object... path)
asChar
public static char asChar(com.google.gson.JsonObject json,
Object... path)
asCharWithDefaultValue
public static char asCharWithDefaultValue(com.google.gson.JsonObject json,
char defaultValue,
Object... path)
asDouble
public static double asDouble(com.google.gson.JsonObject json,
Object... path)
asDoubleWithDefault
public static double asDoubleWithDefault(com.google.gson.JsonObject json,
double defaultValue,
Object... path)
asFloat
public static float asFloat(com.google.gson.JsonObject json,
Object... path)
asFloatWithDefault
public static float asFloatWithDefault(com.google.gson.JsonObject json,
float defaultValue,
Object... path)
asInt
public static int asInt(com.google.gson.JsonObject json,
Object... path)
asIntWithDefault
public static int asIntWithDefault(com.google.gson.JsonObject json,
int defaultValue,
Object... path)
asJson
public static com.google.gson.JsonElement asJson(com.google.gson.JsonElement json,
Object... path)
asJsonArray
public static com.google.gson.JsonArray asJsonArray(com.google.gson.JsonObject json,
Object... path)
asJsonObject
public static com.google.gson.JsonObject asJsonObject(com.google.gson.JsonObject json,
Object... path)
asLong
public static long asLong(com.google.gson.JsonObject json,
Object... path)
asString
public static String asString(com.google.gson.JsonObject json,
Object... path)
asStringWithDefault
public static String asStringWithDefault(com.google.gson.JsonObject json,
String defaultValue,
Object... path)
hasPath
public static boolean hasPath(com.google.gson.JsonObject json,
Object... path)
keyIterator
public static Iterator<String> keyIterator(com.google.gson.JsonObject json)
merge
public static com.google.gson.JsonElement merge(com.google.gson.JsonElement a,
com.google.gson.JsonElement b)
throws JSONException
- Throws:
JSONException
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
toJson
public static com.google.gson.JsonElement toJson(String str)
Copyright © 2013. All Rights Reserved.