public final class JsonFunctions extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.jayway.jsonpath.Configuration |
GSON_CONFIGURATION |
| Modifier and Type | Method and Description |
|---|---|
static int |
ArrayLength(com.google.gson.JsonArray array) |
static com.google.gson.JsonElement |
drop(com.google.gson.JsonElement element,
String field,
String... fields)
Deprecated.
|
static com.google.gson.JsonElement |
drop(String json,
String field,
String... fields)
Deprecated.
|
static boolean |
IsArray(com.google.gson.JsonElement element)
Checks if a Json is
JsonArray. |
static boolean |
IsNull(com.google.gson.JsonElement element)
Checks if a Json is
JsonNull. |
static boolean |
IsObject(com.google.gson.JsonElement element)
Checks if a Json is
JsonObject. |
static boolean |
IsValid(String json)
Checks if a json is valid.
|
static String |
join(com.google.gson.JsonElement element,
String separator)
Deprecated.
|
static com.google.gson.JsonElement |
keysToLower(com.google.gson.JsonElement element)
Deprecated.
|
static com.google.gson.JsonElement |
parse(String json)
Deprecated.
|
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)
Deprecated.
|
static com.google.gson.JsonElement |
select(com.google.gson.JsonElement element,
boolean toLower,
String path,
String... paths)
Deprecated.
|
static com.google.gson.JsonElement |
select(com.google.gson.JsonElement element,
String path,
String... paths)
Deprecated.
|
static com.google.gson.JsonElement |
Select(com.google.gson.JsonElement element,
String path,
String... paths)
Selects part of JSON using JSON DSL specified as json path.
|
static com.google.gson.JsonElement |
select(String json,
boolean toLower,
String path,
String... paths)
Deprecated.
|
static com.google.gson.JsonElement |
select(String json,
String path,
String... paths)
Deprecated.
|
static String |
stringify(com.google.gson.JsonElement element)
Deprecated.
|
static String |
Stringify(com.google.gson.JsonElement element)
This method stringyfies json object.
|
public static final com.jayway.jsonpath.Configuration GSON_CONFIGURATION
@Deprecated public static com.google.gson.JsonElement select(String json, String path, String... paths)
@Deprecated public static com.google.gson.JsonElement select(String json, boolean toLower, String path, String... paths)
@Deprecated public static com.google.gson.JsonElement select(com.google.gson.JsonElement element, String path, String... paths)
@Deprecated public static com.google.gson.JsonElement select(com.google.gson.JsonElement element, boolean toLower, String path, String... paths)
@Deprecated public static com.google.gson.JsonElement drop(String json, String field, String... fields)
@Deprecated 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.@Deprecated public static com.google.gson.JsonElement keysToLower(com.google.gson.JsonElement element)
element - to be transformed.@Deprecated public static String join(com.google.gson.JsonElement element, String separator)
@Deprecated public static String stringify(com.google.gson.JsonElement element)
element - the value to convert to JSON string@Deprecated public static com.google.gson.JsonElement parse(String json)
JSON.parse()
This function by default lowercases the keys.json - string representation of json.@Deprecated 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.public static com.google.gson.JsonElement Parse(String json)
json - string representation of json.public static boolean IsValid(String json)
json - to checked for validity.public static boolean IsNull(com.google.gson.JsonElement element)
JsonNull.element - to be inspected for null.public static boolean IsObject(com.google.gson.JsonElement element)
JsonObject.element - to be inspected for object.public static boolean IsArray(com.google.gson.JsonElement element)
JsonArray.element - to be inspected for array.public static com.google.gson.JsonElement Select(com.google.gson.JsonElement element,
String path,
String... paths)
element - json to be inspected.path - to be searched for in the element.paths - other paths.public static String Stringify(com.google.gson.JsonElement element)
element - the value to convert to JSON string@Nullable public static int ArrayLength(com.google.gson.JsonArray array)
Copyright © 2024 CDAP Licensed under the Apache License, Version 2.0.