Class JsonParserUtil
java.lang.Object
pl.szczurowsky.loottableparser.util.JsonParserUtil
Utility class for parsing JSON files.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.gson.JsonObjectreadFromFile(File file) Reads JSON file and returns it as JsonObject.static com.google.gson.JsonObjectreadFromString(String json) Reads JSON from string and returns it as JsonObject.static com.google.gson.JsonObjectreadFromUrl(URL siteUrl) Reads JSON file from URL and returns it as JsonObject.
-
Method Details
-
readFromFile
Reads JSON file and returns it as JsonObject.- Parameters:
file- JSON file to read.- Returns:
- JsonObject representing the file.
-
readFromUrl
Reads JSON file from URL and returns it as JsonObject.- Parameters:
siteUrl- URL to read.- Returns:
- JsonObject representing the file.
-
readFromString
Reads JSON from string and returns it as JsonObject.- Parameters:
json- JSON to read.- Returns:
- JsonObject representing the file.
-