public class JSONUtils
extends java.lang.Object
コンストラクタと説明 |
---|
JSONUtils() |
修飾子とタイプ | メソッドと説明 |
---|---|
static <T> T |
deserializeClass(com.google.gson.JsonElement json,
java.lang.String memberName,
com.google.gson.JsonDeserializationContext context,
java.lang.Class<? extends T> adapter) |
static <T> T |
deserializeClass(com.google.gson.JsonObject json,
java.lang.String memberName,
com.google.gson.JsonDeserializationContext context,
java.lang.Class<? extends T> adapter) |
static <T> T |
deserializeClass(com.google.gson.JsonObject json,
java.lang.String memberName,
T fallback,
com.google.gson.JsonDeserializationContext context,
java.lang.Class<? extends T> adapter) |
static <T> T |
fromJson(com.google.gson.Gson gson,
java.io.Reader reader,
java.lang.Class<T> jsonClass) |
static <T> T |
fromJson(com.google.gson.Gson gsonIn,
java.io.Reader readerIn,
java.lang.Class<T> adapter,
boolean lenient) |
static <T> T |
fromJson(com.google.gson.Gson gson,
java.io.Reader reader,
java.lang.reflect.Type type) |
static <T> T |
fromJson(com.google.gson.Gson gson,
java.io.Reader reader,
java.lang.reflect.Type type,
boolean lenient) |
static <T> T |
fromJson(com.google.gson.Gson gsonIn,
java.lang.String json,
java.lang.Class<T> adapter) |
static <T> T |
fromJson(com.google.gson.Gson gsonIn,
java.lang.String json,
java.lang.Class<T> adapter,
boolean lenient) |
static <T> T |
fromJson(com.google.gson.Gson gson,
java.lang.String json,
java.lang.reflect.Type type) |
static <T> T |
fromJson(com.google.gson.Gson gson,
java.lang.String json,
java.lang.reflect.Type type,
boolean lenient) |
static com.google.gson.JsonObject |
fromJson(java.io.Reader p_212743_0_) |
static com.google.gson.JsonObject |
fromJson(java.io.Reader p_212744_0_,
boolean p_212744_1_) |
static com.google.gson.JsonObject |
fromJson(java.lang.String p_212745_0_) |
static com.google.gson.JsonObject |
fromJson(java.lang.String p_212746_0_,
boolean p_212746_1_) |
static long |
func_219794_f(com.google.gson.JsonElement p_219794_0_,
java.lang.String p_219794_1_) |
static byte |
func_219795_a(com.google.gson.JsonObject p_219795_0_,
java.lang.String p_219795_1_,
byte p_219795_2_) |
static long |
func_219796_a(com.google.gson.JsonObject p_219796_0_,
java.lang.String p_219796_1_,
long p_219796_2_) |
static long |
func_226161_m_(com.google.gson.JsonObject p_226161_0_,
java.lang.String p_226161_1_) |
static boolean |
getBoolean(com.google.gson.JsonElement json,
java.lang.String memberName)
Gets the boolean value of the given JsonElement.
|
static boolean |
getBoolean(com.google.gson.JsonObject json,
java.lang.String memberName)
Gets the boolean value of the field on the JsonObject with the given name.
|
static boolean |
getBoolean(com.google.gson.JsonObject json,
java.lang.String memberName,
boolean fallback)
Gets the boolean value of the field on the JsonObject with the given name, or the given default value if the field
is missing.
|
static byte |
getByte(com.google.gson.JsonElement json,
java.lang.String memberName) |
static float |
getFloat(com.google.gson.JsonElement json,
java.lang.String memberName)
Gets the float value of the given JsonElement.
|
static float |
getFloat(com.google.gson.JsonObject json,
java.lang.String memberName)
Gets the float value of the field on the JsonObject with the given name.
|
static float |
getFloat(com.google.gson.JsonObject json,
java.lang.String memberName,
float fallback)
Gets the float value of the field on the JsonObject with the given name, or the given default value if the field
is missing.
|
static int |
getInt(com.google.gson.JsonElement json,
java.lang.String memberName)
Gets the integer value of the given JsonElement.
|
static int |
getInt(com.google.gson.JsonObject json,
java.lang.String memberName)
Gets the integer value of the field on the JsonObject with the given name.
|
static int |
getInt(com.google.gson.JsonObject json,
java.lang.String memberName,
int fallback)
Gets the integer value of the field on the JsonObject with the given name, or the given default value if the field
is missing.
|
static Item |
getItem(com.google.gson.JsonElement json,
java.lang.String memberName) |
static Item |
getItem(com.google.gson.JsonObject json,
java.lang.String memberName) |
static com.google.gson.JsonArray |
getJsonArray(com.google.gson.JsonElement json,
java.lang.String memberName)
Gets the given JsonElement as a JsonArray.
|
static com.google.gson.JsonArray |
getJsonArray(com.google.gson.JsonObject json,
java.lang.String memberName)
Gets the JsonArray field on the JsonObject with the given name.
|
static com.google.gson.JsonArray |
getJsonArray(com.google.gson.JsonObject json,
java.lang.String memberName,
com.google.gson.JsonArray fallback)
Gets the JsonArray field on the JsonObject with the given name, or the given default value if the field is
missing.
|
static com.google.gson.JsonObject |
getJsonObject(com.google.gson.JsonElement json,
java.lang.String memberName)
Gets the given JsonElement as a JsonObject.
|
static com.google.gson.JsonObject |
getJsonObject(com.google.gson.JsonObject json,
java.lang.String memberName) |
static com.google.gson.JsonObject |
getJsonObject(com.google.gson.JsonObject json,
java.lang.String memberName,
com.google.gson.JsonObject fallback)
Gets the JsonObject field on the JsonObject with the given name, or the given default value if the field is
missing.
|
static java.lang.String |
getString(com.google.gson.JsonElement json,
java.lang.String memberName)
Gets the string value of the given JsonElement.
|
static java.lang.String |
getString(com.google.gson.JsonObject json,
java.lang.String memberName)
Gets the string value of the field on the JsonObject with the given name.
|
static java.lang.String |
getString(com.google.gson.JsonObject json,
java.lang.String memberName,
java.lang.String fallback)
Gets the string value of the field on the JsonObject with the given name, or the given default value if the field
is missing.
|
static boolean |
hasField(com.google.gson.JsonObject json,
java.lang.String memberName)
Does the given JsonObject contain a field with the given name?
|
static boolean |
isBoolean(com.google.gson.JsonObject json,
java.lang.String memberName) |
static boolean |
isJsonArray(com.google.gson.JsonObject json,
java.lang.String memberName)
Does the given JsonObject contain an array field with the given name?
|
static boolean |
isJsonPrimitive(com.google.gson.JsonObject json,
java.lang.String memberName)
Does the given JsonObject contain a field with the given name whose type is primitive (String, Java primitive, or
Java primitive wrapper)?
|
static boolean |
isNumber(com.google.gson.JsonElement json) |
static boolean |
isString(com.google.gson.JsonElement json)
Is the given JsonElement a string?
|
static boolean |
isString(com.google.gson.JsonObject json,
java.lang.String memberName)
Does the given JsonObject contain a string field with the given name?
|
static java.lang.String |
toString(com.google.gson.JsonElement json)
Gets a human-readable description of the given JsonElement's type.
|
public static boolean isString(com.google.gson.JsonObject json, java.lang.String memberName)
public static boolean isString(com.google.gson.JsonElement json)
public static boolean isNumber(com.google.gson.JsonElement json)
public static boolean isBoolean(com.google.gson.JsonObject json, java.lang.String memberName)
public static boolean isJsonArray(com.google.gson.JsonObject json, java.lang.String memberName)
public static boolean isJsonPrimitive(com.google.gson.JsonObject json, java.lang.String memberName)
public static boolean hasField(com.google.gson.JsonObject json, java.lang.String memberName)
public static java.lang.String getString(com.google.gson.JsonElement json, java.lang.String memberName)
public static java.lang.String getString(com.google.gson.JsonObject json, java.lang.String memberName)
public static java.lang.String getString(com.google.gson.JsonObject json, java.lang.String memberName, java.lang.String fallback)
public static Item getItem(com.google.gson.JsonElement json, java.lang.String memberName)
public static Item getItem(com.google.gson.JsonObject json, java.lang.String memberName)
public static boolean getBoolean(com.google.gson.JsonElement json, java.lang.String memberName)
public static boolean getBoolean(com.google.gson.JsonObject json, java.lang.String memberName)
public static boolean getBoolean(com.google.gson.JsonObject json, java.lang.String memberName, boolean fallback)
public static float getFloat(com.google.gson.JsonElement json, java.lang.String memberName)
public static float getFloat(com.google.gson.JsonObject json, java.lang.String memberName)
public static float getFloat(com.google.gson.JsonObject json, java.lang.String memberName, float fallback)
public static long func_219794_f(com.google.gson.JsonElement p_219794_0_, java.lang.String p_219794_1_)
public static long func_226161_m_(com.google.gson.JsonObject p_226161_0_, java.lang.String p_226161_1_)
public static long func_219796_a(com.google.gson.JsonObject p_219796_0_, java.lang.String p_219796_1_, long p_219796_2_)
public static int getInt(com.google.gson.JsonElement json, java.lang.String memberName)
public static int getInt(com.google.gson.JsonObject json, java.lang.String memberName)
public static int getInt(com.google.gson.JsonObject json, java.lang.String memberName, int fallback)
public static byte getByte(com.google.gson.JsonElement json, java.lang.String memberName)
public static byte func_219795_a(com.google.gson.JsonObject p_219795_0_, java.lang.String p_219795_1_, byte p_219795_2_)
public static com.google.gson.JsonObject getJsonObject(com.google.gson.JsonElement json, java.lang.String memberName)
public static com.google.gson.JsonObject getJsonObject(com.google.gson.JsonObject json, java.lang.String memberName)
public static com.google.gson.JsonObject getJsonObject(com.google.gson.JsonObject json, java.lang.String memberName, com.google.gson.JsonObject fallback)
public static com.google.gson.JsonArray getJsonArray(com.google.gson.JsonElement json, java.lang.String memberName)
public static com.google.gson.JsonArray getJsonArray(com.google.gson.JsonObject json, java.lang.String memberName)
@Nullable public static com.google.gson.JsonArray getJsonArray(com.google.gson.JsonObject json, java.lang.String memberName, @Nullable com.google.gson.JsonArray fallback)
public static <T> T deserializeClass(@Nullable com.google.gson.JsonElement json, java.lang.String memberName, com.google.gson.JsonDeserializationContext context, java.lang.Class<? extends T> adapter)
public static <T> T deserializeClass(com.google.gson.JsonObject json, java.lang.String memberName, com.google.gson.JsonDeserializationContext context, java.lang.Class<? extends T> adapter)
public static <T> T deserializeClass(com.google.gson.JsonObject json, java.lang.String memberName, T fallback, com.google.gson.JsonDeserializationContext context, java.lang.Class<? extends T> adapter)
public static java.lang.String toString(com.google.gson.JsonElement json)
@Nullable public static <T> T fromJson(com.google.gson.Gson gsonIn, java.io.Reader readerIn, java.lang.Class<T> adapter, boolean lenient)
@Nullable public static <T> T fromJson(com.google.gson.Gson gson, java.io.Reader reader, java.lang.reflect.Type type, boolean lenient)
@Nullable public static <T> T fromJson(com.google.gson.Gson gson, java.lang.String json, java.lang.reflect.Type type, boolean lenient)
@Nullable public static <T> T fromJson(com.google.gson.Gson gsonIn, java.lang.String json, java.lang.Class<T> adapter, boolean lenient)
@Nullable public static <T> T fromJson(com.google.gson.Gson gson, java.io.Reader reader, java.lang.reflect.Type type)
@Nullable public static <T> T fromJson(com.google.gson.Gson gson, java.lang.String json, java.lang.reflect.Type type)
@Nullable public static <T> T fromJson(com.google.gson.Gson gson, java.io.Reader reader, java.lang.Class<T> jsonClass)
@Nullable public static <T> T fromJson(com.google.gson.Gson gsonIn, java.lang.String json, java.lang.Class<T> adapter)
public static com.google.gson.JsonObject fromJson(java.lang.String p_212746_0_, boolean p_212746_1_)
public static com.google.gson.JsonObject fromJson(java.io.Reader p_212744_0_, boolean p_212744_1_)
public static com.google.gson.JsonObject fromJson(java.lang.String p_212745_0_)
public static com.google.gson.JsonObject fromJson(java.io.Reader p_212743_0_)