public final class JSON extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.jayway.jsonpath.Configuration |
GSON_CONFIGURATION |
| Constructor and Description |
|---|
JSON() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.gson.JsonElement |
drop(com.google.gson.JsonElement element,
String field,
String... fields)
Removes fields from a JSON inline.
|
static com.google.gson.JsonElement |
drop(String json,
String field,
String... fields) |
static String |
join(com.google.gson.JsonElement element,
String separator) |
static com.google.gson.JsonElement |
keysToLower(com.google.gson.JsonElement element)
This function lowers the keys of the json.
|
static com.google.gson.JsonElement |
parse(String json)
Parses a column or string to JSON.
|
static com.google.gson.JsonElement |
parse(String json,
boolean toLower)
Parses a column or string to JSON.
|
static com.google.gson.JsonElement |
select(com.google.gson.JsonElement element,
boolean toLower,
String path,
String... paths) |
static com.google.gson.JsonElement |
select(com.google.gson.JsonElement element,
String path,
String... paths) |
static com.google.gson.JsonElement |
select(String json,
boolean toLower,
String path,
String... paths) |
static com.google.gson.JsonElement |
select(String json,
String path,
String... paths) |
static String |
stringify(com.google.gson.JsonElement element)
This method converts a JavaScript value to a JSON string.
|
public static final com.jayway.jsonpath.Configuration GSON_CONFIGURATION
public static com.google.gson.JsonElement select(String json, boolean toLower, String path, String... paths)
public static com.google.gson.JsonElement select(com.google.gson.JsonElement element,
String path,
String... paths)
public static com.google.gson.JsonElement select(com.google.gson.JsonElement element,
boolean toLower,
String path,
String... paths)
public static com.google.gson.JsonElement drop(com.google.gson.JsonElement element,
String field,
String... fields)
element - Json element to be parsed.field - first field to be deleted.fields - list of fields to be deleted.public static com.google.gson.JsonElement keysToLower(com.google.gson.JsonElement element)
element - to be transformed.public static String stringify(com.google.gson.JsonElement element)
element - the value to convert to JSON stringpublic static com.google.gson.JsonElement parse(String json)
JSON.parse()
This function by default lowercases the keys.json - string representation of json.public static com.google.gson.JsonElement parse(String json, boolean toLower)
JSON.parse()json - string representation of json.toLower - true to lower case keys, false to leave it as-is.Copyright © 2020 CDAP Licensed under the Apache License, Version 2.0.