Package org.polyfrost.oneconfig.utils.v1
Class JsonUtils
java.lang.Object
org.polyfrost.oneconfig.utils.v1.JsonUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.gson.JsonParserDeprecated.The json parser by default accepts non-json compliant formats, this enables parsing invalid json and therefore may cause undesired behaviour. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull com.google.gson.JsonElementstatic voidstatic @Nullable com.google.gson.JsonElementparseFromUrl(String url) static voidparseFromUrl(String url, Consumer<@NotNull com.google.gson.JsonElement> action) static voidparseFromUrlAsync(String url, Consumer<@NotNull com.google.gson.JsonElement> action) static @Nullable com.google.gson.JsonElementparseOrNull(String json)
-
Field Details
-
PARSER
Deprecated.The json parser by default accepts non-json compliant formats, this enables parsing invalid json and therefore may cause undesired behaviour.
-
-
Method Details
-
parse
@NotNull public static @NotNull com.google.gson.JsonElement parse(String json) throws com.google.gson.JsonSyntaxException - Throws:
com.google.gson.JsonSyntaxException
-
parseOrNull
-
parse
-
parseFromUrl
-
parseFromUrl
-
parseFromUrlAsync
-