Utilities for examining and processing content that is or can be JSON.
Type Params | Return Type | Name and description |
---|---|---|
|
static void |
ensureJsonValid(java.lang.String value) |
|
static java.lang.String |
format(java.lang.Object json) |
|
static Configuration |
getDefaultConfiguration() |
|
java.lang.String |
getFormattedStringValue(JsonNode value) |
|
static JsonNode |
getJson(java.lang.String value) |
|
static JsonNode |
getJsonFromXml(java.lang.String xml) |
|
static java.lang.String |
getJsonNodeText(JsonNode jsonNode) |
|
static ObjectMapper |
getMapper() |
|
static java.lang.String |
getStringRepresentationForValueNode(ValueNode value) |
|
static JsonNode |
getValidJson(java.lang.String value) |
|
static JsonNode |
getValidJson(java.lang.String value, ObjectMapper mapper) |
|
static JsonNode |
getValidJsonFromXml(java.lang.String xml) |
|
static java.lang.Object |
getValueNodeValue(ValueNode node) |
|
static XmlMapper |
getXmlMapper() |
|
static boolean |
isObjectOrArray(java.lang.String value) |
|
static boolean |
isSimpleValue(java.lang.String value) |
|
static boolean |
isValidJson(java.lang.String value) |
|
static JsonNode |
parseTrimmedText(java.lang.String text) |
|
static java.lang.String |
removeVulnerabilityTokens(java.lang.String inputJsonString) |
|
static boolean |
seemsToBeJson(java.lang.String content, boolean failOnTrailingTokens) Since ObjectMapper is able to read a JSON text as a serialized value also, the method with the feature option provides more strict validation for an invalid JSON text JsonUtil.seemsToBeJson |
|
static boolean |
seemsToBeJson(java.lang.String content) |
|
static boolean |
seemsToBeJsonContentType(java.lang.String contentType) This method and its name are somewhat awkward, but both stem from the fact that there are so many commonly used content types for JSON. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Since ObjectMapper is able to read a JSON text as a serialized value also, the method with the feature option provides more strict validation for an invalid JSON text JsonUtil.seemsToBeJson
content
- content to readfailOnTrailingTokens
- parameter means the parser should fail if there are any trailing tokens,
provides more strict json validationThis method and its name are somewhat awkward, but both stem from the fact that there are so many commonly used content types for JSON.
contentType
- the MIME type to examinetrue
if content type is non-null and contains either "json" or "javascript"