Class JsonUtilities
-
- All Implemented Interfaces:
public final class JsonUtilitiesJSON-based utility methods for acquiring and working with JSON from files and objects.
Griefed
-
-
Field Summary
Fields Modifier and Type Field Description private final ObjectMapperobjectMapper
-
Constructor Summary
Constructors Constructor Description JsonUtilities(ObjectMapper objectMapper)
-
Method Summary
Modifier and Type Method Description final ObjectMappergetObjectMapper()Used for JSON-parsing. final BooleannestedTextMatches(JsonNode jsonNode, Regex matches, String childNodes)Whether the text in jsonNode's nested childNodes, read in order, matches matches. final StringgetNestedText(JsonNode jsonNode, String childNodes)The text from jsonNode's nested childNodes, read in order. final JsonNodegetNestedElement(JsonNode jsonNode, String childNodes)Get a nested element from a JsonNode. final BooleannestedTextEqualsIgnoreCase(JsonNode jsonNode, String equalsIgnoreCase, String childNodes)Whether the text in jsonNode's nested childNodes, read in order, equals equalsIgnoreCase, ignoring case. final BooleannestedTextIsEmpty(JsonNode jsonNode, String childNodes)Whether the text in jsonNode's nested childNodes, read in order, is empty. final BooleangetNestedBoolean(JsonNode jsonNode, String childNodes)The boolean value from the nested child node(s). final Array<String>getNestedTexts(JsonNode jsonNode, String split, String childNodes)The texts from jsonNode's nested childNodes, read in order, with the last node's text split into an array on split. final BooleannestedTextContains(JsonNode jsonNode, String contains, String childNodes)Whether the text in jsonNode's nested childNodes, read in order, contains contains. final Iterator<String>getFieldNames(JsonNode jsonNode, String childNodes)A string iterator over the field names of the last of jsonNode's nested childNodes, read in order. final JsonNodegetJson(InputStream inputStream)The JsonNode parsed from inputStream. final JsonNodegetJson(String string)The JsonNode parsed from string. final JsonNodegetJson(File file)The JsonNode parsed from file. final JsonNodegetJson(URL url)The JsonNode parsed from the data at url. -
-
Method Detail
-
getObjectMapper
final ObjectMapper getObjectMapper()
Used for JSON-parsing.
-
nestedTextMatches
final Boolean nestedTextMatches(JsonNode jsonNode, Regex matches, String childNodes)
Whether the text in jsonNode's nested childNodes, read in order, matches matches.
-
getNestedText
final String getNestedText(JsonNode jsonNode, String childNodes)
The text from jsonNode's nested childNodes, read in order.
-
getNestedElement
final JsonNode getNestedElement(JsonNode jsonNode, String childNodes)
Get a nested element from a JsonNode.
-
nestedTextEqualsIgnoreCase
final Boolean nestedTextEqualsIgnoreCase(JsonNode jsonNode, String equalsIgnoreCase, String childNodes)
Whether the text in jsonNode's nested childNodes, read in order, equals equalsIgnoreCase, ignoring case.
-
nestedTextIsEmpty
final Boolean nestedTextIsEmpty(JsonNode jsonNode, String childNodes)
Whether the text in jsonNode's nested childNodes, read in order, is empty.
-
getNestedBoolean
final Boolean getNestedBoolean(JsonNode jsonNode, String childNodes)
The boolean value from the nested child node(s).
-
getNestedTexts
final Array<String> getNestedTexts(JsonNode jsonNode, String split, String childNodes)
The texts from jsonNode's nested childNodes, read in order, with the last node's text split into an array on split.
-
nestedTextContains
final Boolean nestedTextContains(JsonNode jsonNode, String contains, String childNodes)
Whether the text in jsonNode's nested childNodes, read in order, contains contains.
-
getFieldNames
final Iterator<String> getFieldNames(JsonNode jsonNode, String childNodes)
A string iterator over the field names of the last of jsonNode's nested childNodes, read in order.
-
getJson
final JsonNode getJson(InputStream inputStream)
The JsonNode parsed from inputStream.
-
-
-
-