Package dev.latvian.mods.kubejs.util
Class JsonIO
java.lang.Object
dev.latvian.mods.kubejs.util.JsonIO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]getJsonHashBytes(com.google.gson.JsonElement json) static StringgetJsonHashString(com.google.gson.JsonElement json) static Objectstatic com.google.gson.JsonElementstatic @Nullable Map<?, ?> static @Nullable com.google.gson.JsonElementstatic StringreadString(Path path) static com.google.gson.JsonArraytoArray(com.google.gson.JsonElement element) static @Nullable ObjecttoObject(@Nullable com.google.gson.JsonElement json) static StringtoPrettyString(com.google.gson.JsonElement json) static @Nullable ObjecttoPrimitive(@Nullable com.google.gson.JsonElement element) static StringtoString(com.google.gson.JsonElement json) static voidstatic voidwriteJsonHash(DataOutputStream stream, @Nullable com.google.gson.JsonElement element)
-
Constructor Details
-
JsonIO
public JsonIO()
-
-
Method Details
-
toObject
@Nullable public static @Nullable Object toObject(@Nullable @Nullable com.google.gson.JsonElement json) -
toString
-
toPrettyString
-
parseRaw
-
parse
-
toPrimitive
@Nullable public static @Nullable Object toPrimitive(@Nullable @Nullable com.google.gson.JsonElement element) -
readJson
@Nullable public static @Nullable com.google.gson.JsonElement readJson(Path path) throws IOException - Throws:
IOException
-
readString
- Throws:
IOException
-
read
@Nullable public static @Nullable Map<?,?> read(dev.latvian.mods.rhino.Context cx, Path path) throws IOException - Throws:
IOException
-
write
public static void write(Path path, @Nullable @Nullable com.google.gson.JsonElement json) throws IOException - Throws:
IOException
-
toArray
public static com.google.gson.JsonArray toArray(com.google.gson.JsonElement element) -
writeJsonHash
public static void writeJsonHash(DataOutputStream stream, @Nullable @Nullable com.google.gson.JsonElement element) throws IOException - Throws:
IOException
-
getJsonHashBytes
public static byte[] getJsonHashBytes(com.google.gson.JsonElement json) -
getJsonHashString
-