JSON utilities
Getting JSON elements from a string
Unsafe (exceptional) parsing
JsonElement jsonElement = JsonUtils.parse("{}");Safe parsing
JsonElement jsonElement1 = JsonUtils.parseOrNull("{}"); // non-null, JsonObject
JsonElement jsonElement2 = JsonUtils.parseOrNull("Hello, OneConfig!"); // nullSafe parsing via callbacks
JsonUtils.parse("{}", (jsonElement) -> {
System.out.println("I'll print out if the JSON is parsed properly! " + jsonElement);
});Last updated