Class JsonParserUtil

java.lang.Object
pl.szczurowsky.loottableparser.util.JsonParserUtil

public class JsonParserUtil extends Object
Utility class for parsing JSON files.
  • Method Details

    • readFromFile

      public static com.google.gson.JsonObject readFromFile(File file)
      Reads JSON file and returns it as JsonObject.
      Parameters:
      file - JSON file to read.
      Returns:
      JsonObject representing the file.
    • readFromUrl

      public static com.google.gson.JsonObject readFromUrl(URL siteUrl)
      Reads JSON file from URL and returns it as JsonObject.
      Parameters:
      siteUrl - URL to read.
      Returns:
      JsonObject representing the file.
    • readFromString

      public static com.google.gson.JsonObject readFromString(String json)
      Reads JSON from string and returns it as JsonObject.
      Parameters:
      json - JSON to read.
      Returns:
      JsonObject representing the file.