Class JsonIO

java.lang.Object
dev.latvian.mods.kubejs.util.JsonIO

public class JsonIO extends Object
  • Constructor Details

    • JsonIO

      public JsonIO()
  • Method Details

    • toObject

      @Nullable public static @Nullable Object toObject(@Nullable @Nullable com.google.gson.JsonElement json)
    • toString

      public static String toString(com.google.gson.JsonElement json)
    • toPrettyString

      public static String toPrettyString(com.google.gson.JsonElement json)
    • parseRaw

      public static com.google.gson.JsonElement parseRaw(@Nullable @Nullable String string)
    • parse

      public static Object parse(String string)
    • 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

      public static String readString(Path path) throws IOException
      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

      public static String getJsonHashString(com.google.gson.JsonElement json)