public class JsonFunctions
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
JsonFunctions.JsonPathContext
Returned path context of JsonApiCommonSyntax, public for testing.
|
static class |
JsonFunctions.JsonValueContext
The Java output of
SqlJsonValueExpressionOperator . |
static class |
JsonFunctions.PathMode
Path spec has two different modes: lax mode and strict mode.
|
Modifier and Type | Field and Description |
---|---|
private static java.util.regex.Pattern |
JSON_PATH_BASE |
private static com.jayway.jsonpath.spi.json.JacksonJsonProvider |
JSON_PATH_JSON_PROVIDER |
private static com.jayway.jsonpath.spi.mapper.MappingProvider |
JSON_PATH_MAPPING_PROVIDER |
private static com.fasterxml.jackson.core.PrettyPrinter |
JSON_PRETTY_PRINTER |
Modifier | Constructor and Description |
---|---|
private |
JsonFunctions() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.Integer |
calculateDepth(java.lang.Object o) |
static java.lang.Object |
dejsonize(java.lang.String input) |
static boolean |
isJsonArray(java.lang.String input) |
static boolean |
isJsonObject(java.lang.String input) |
static boolean |
isJsonScalar(java.lang.String input) |
static boolean |
isJsonValue(java.lang.String input) |
private static boolean |
isScalarObject(java.lang.Object obj) |
static JsonFunctions.JsonPathContext |
jsonApiCommonSyntax(JsonFunctions.JsonValueContext input) |
static JsonFunctions.JsonPathContext |
jsonApiCommonSyntax(JsonFunctions.JsonValueContext input,
java.lang.String pathSpec) |
static JsonFunctions.JsonPathContext |
jsonApiCommonSyntax(java.lang.String input) |
static JsonFunctions.JsonPathContext |
jsonApiCommonSyntax(java.lang.String input,
java.lang.String pathSpec) |
static java.lang.String |
jsonArray(SqlJsonConstructorNullClause nullClause,
java.lang.Object... elements) |
static void |
jsonArrayAggAdd(java.util.List list,
java.lang.Object element,
SqlJsonConstructorNullClause nullClause) |
static java.lang.Integer |
jsonDepth(JsonFunctions.JsonValueContext input) |
static java.lang.Integer |
jsonDepth(java.lang.String input) |
static java.lang.Boolean |
jsonExists(JsonFunctions.JsonPathContext context) |
static java.lang.Boolean |
jsonExists(JsonFunctions.JsonPathContext context,
SqlJsonExistsErrorBehavior errorBehavior) |
static java.lang.Boolean |
jsonExists(JsonFunctions.JsonValueContext input,
java.lang.String pathSpec) |
static java.lang.Boolean |
jsonExists(JsonFunctions.JsonValueContext input,
java.lang.String pathSpec,
SqlJsonExistsErrorBehavior errorBehavior) |
static java.lang.Boolean |
jsonExists(java.lang.String input,
java.lang.String pathSpec) |
static java.lang.Boolean |
jsonExists(java.lang.String input,
java.lang.String pathSpec,
SqlJsonExistsErrorBehavior errorBehavior) |
static java.lang.String |
jsonize(java.lang.Object input) |
static java.lang.String |
jsonKeys(JsonFunctions.JsonPathContext context) |
static java.lang.String |
jsonKeys(JsonFunctions.JsonValueContext input) |
static java.lang.String |
jsonKeys(JsonFunctions.JsonValueContext input,
java.lang.String pathSpec) |
static java.lang.String |
jsonKeys(java.lang.String input) |
static java.lang.String |
jsonKeys(java.lang.String input,
java.lang.String pathSpec) |
static java.lang.Integer |
jsonLength(JsonFunctions.JsonPathContext context) |
static java.lang.Integer |
jsonLength(JsonFunctions.JsonValueContext input) |
static java.lang.Integer |
jsonLength(JsonFunctions.JsonValueContext input,
java.lang.String pathSpec) |
static java.lang.Integer |
jsonLength(java.lang.String input) |
static java.lang.Integer |
jsonLength(java.lang.String input,
java.lang.String pathSpec) |
static java.lang.String |
jsonObject(SqlJsonConstructorNullClause nullClause,
java.lang.Object... kvs) |
static void |
jsonObjectAggAdd(java.util.Map map,
java.lang.String k,
java.lang.Object v,
SqlJsonConstructorNullClause nullClause) |
static java.lang.String |
jsonPretty(JsonFunctions.JsonValueContext input) |
static java.lang.String |
jsonPretty(java.lang.String input) |
static java.lang.String |
jsonQuery(JsonFunctions.JsonPathContext context,
SqlJsonQueryWrapperBehavior wrapperBehavior,
SqlJsonQueryEmptyOrErrorBehavior emptyBehavior,
SqlJsonQueryEmptyOrErrorBehavior errorBehavior) |
static java.lang.String |
jsonQuery(JsonFunctions.JsonValueContext input,
java.lang.String pathSpec,
SqlJsonQueryWrapperBehavior wrapperBehavior,
SqlJsonQueryEmptyOrErrorBehavior emptyBehavior,
SqlJsonQueryEmptyOrErrorBehavior errorBehavior) |
static java.lang.String |
jsonQuery(java.lang.String input,
java.lang.String pathSpec,
SqlJsonQueryWrapperBehavior wrapperBehavior,
SqlJsonQueryEmptyOrErrorBehavior emptyBehavior,
SqlJsonQueryEmptyOrErrorBehavior errorBehavior) |
static java.lang.String |
jsonRemove(JsonFunctions.JsonValueContext input,
java.lang.String... pathSpecs) |
static java.lang.String |
jsonRemove(java.lang.String input,
java.lang.String... pathSpecs) |
static java.lang.Integer |
jsonStorageSize(JsonFunctions.JsonValueContext input) |
static java.lang.Integer |
jsonStorageSize(java.lang.String input) |
static java.lang.String |
jsonType(JsonFunctions.JsonValueContext input) |
static java.lang.String |
jsonType(java.lang.String input) |
static java.lang.Object |
jsonValueAny(JsonFunctions.JsonPathContext context,
SqlJsonValueEmptyOrErrorBehavior emptyBehavior,
java.lang.Object defaultValueOnEmpty,
SqlJsonValueEmptyOrErrorBehavior errorBehavior,
java.lang.Object defaultValueOnError) |
static java.lang.Object |
jsonValueAny(JsonFunctions.JsonValueContext input,
java.lang.String pathSpec,
SqlJsonValueEmptyOrErrorBehavior emptyBehavior,
java.lang.Object defaultValueOnEmpty,
SqlJsonValueEmptyOrErrorBehavior errorBehavior,
java.lang.Object defaultValueOnError) |
static java.lang.Object |
jsonValueAny(java.lang.String input,
java.lang.String pathSpec,
SqlJsonValueEmptyOrErrorBehavior emptyBehavior,
java.lang.Object defaultValueOnEmpty,
SqlJsonValueEmptyOrErrorBehavior errorBehavior,
java.lang.Object defaultValueOnError) |
static JsonFunctions.JsonValueContext |
jsonValueExpression(java.lang.String input) |
private static java.lang.RuntimeException |
toUnchecked(java.lang.Exception e) |
private static final java.util.regex.Pattern JSON_PATH_BASE
private static final com.jayway.jsonpath.spi.json.JacksonJsonProvider JSON_PATH_JSON_PROVIDER
private static final com.jayway.jsonpath.spi.mapper.MappingProvider JSON_PATH_MAPPING_PROVIDER
private static final com.fasterxml.jackson.core.PrettyPrinter JSON_PRETTY_PRINTER
private static boolean isScalarObject(java.lang.Object obj)
public static java.lang.String jsonize(java.lang.Object input)
public static java.lang.Object dejsonize(java.lang.String input)
public static JsonFunctions.JsonValueContext jsonValueExpression(java.lang.String input)
public static JsonFunctions.JsonPathContext jsonApiCommonSyntax(java.lang.String input)
public static JsonFunctions.JsonPathContext jsonApiCommonSyntax(JsonFunctions.JsonValueContext input)
public static JsonFunctions.JsonPathContext jsonApiCommonSyntax(java.lang.String input, java.lang.String pathSpec)
public static JsonFunctions.JsonPathContext jsonApiCommonSyntax(JsonFunctions.JsonValueContext input, java.lang.String pathSpec)
public static java.lang.Boolean jsonExists(java.lang.String input, java.lang.String pathSpec)
public static java.lang.Boolean jsonExists(java.lang.String input, java.lang.String pathSpec, SqlJsonExistsErrorBehavior errorBehavior)
public static java.lang.Boolean jsonExists(JsonFunctions.JsonValueContext input, java.lang.String pathSpec)
public static java.lang.Boolean jsonExists(JsonFunctions.JsonValueContext input, java.lang.String pathSpec, SqlJsonExistsErrorBehavior errorBehavior)
public static java.lang.Boolean jsonExists(JsonFunctions.JsonPathContext context)
public static java.lang.Boolean jsonExists(JsonFunctions.JsonPathContext context, SqlJsonExistsErrorBehavior errorBehavior)
public static java.lang.Object jsonValueAny(java.lang.String input, java.lang.String pathSpec, SqlJsonValueEmptyOrErrorBehavior emptyBehavior, java.lang.Object defaultValueOnEmpty, SqlJsonValueEmptyOrErrorBehavior errorBehavior, java.lang.Object defaultValueOnError)
public static java.lang.Object jsonValueAny(JsonFunctions.JsonValueContext input, java.lang.String pathSpec, SqlJsonValueEmptyOrErrorBehavior emptyBehavior, java.lang.Object defaultValueOnEmpty, SqlJsonValueEmptyOrErrorBehavior errorBehavior, java.lang.Object defaultValueOnError)
public static java.lang.Object jsonValueAny(JsonFunctions.JsonPathContext context, SqlJsonValueEmptyOrErrorBehavior emptyBehavior, java.lang.Object defaultValueOnEmpty, SqlJsonValueEmptyOrErrorBehavior errorBehavior, java.lang.Object defaultValueOnError)
public static java.lang.String jsonQuery(java.lang.String input, java.lang.String pathSpec, SqlJsonQueryWrapperBehavior wrapperBehavior, SqlJsonQueryEmptyOrErrorBehavior emptyBehavior, SqlJsonQueryEmptyOrErrorBehavior errorBehavior)
public static java.lang.String jsonQuery(JsonFunctions.JsonValueContext input, java.lang.String pathSpec, SqlJsonQueryWrapperBehavior wrapperBehavior, SqlJsonQueryEmptyOrErrorBehavior emptyBehavior, SqlJsonQueryEmptyOrErrorBehavior errorBehavior)
public static java.lang.String jsonQuery(JsonFunctions.JsonPathContext context, SqlJsonQueryWrapperBehavior wrapperBehavior, SqlJsonQueryEmptyOrErrorBehavior emptyBehavior, SqlJsonQueryEmptyOrErrorBehavior errorBehavior)
public static java.lang.String jsonObject(SqlJsonConstructorNullClause nullClause, java.lang.Object... kvs)
public static void jsonObjectAggAdd(java.util.Map map, java.lang.String k, java.lang.Object v, SqlJsonConstructorNullClause nullClause)
public static java.lang.String jsonArray(SqlJsonConstructorNullClause nullClause, java.lang.Object... elements)
public static void jsonArrayAggAdd(java.util.List list, java.lang.Object element, SqlJsonConstructorNullClause nullClause)
public static java.lang.String jsonPretty(java.lang.String input)
public static java.lang.String jsonPretty(JsonFunctions.JsonValueContext input)
public static java.lang.String jsonType(java.lang.String input)
public static java.lang.String jsonType(JsonFunctions.JsonValueContext input)
public static java.lang.Integer jsonDepth(java.lang.String input)
public static java.lang.Integer jsonDepth(JsonFunctions.JsonValueContext input)
private static java.lang.Integer calculateDepth(java.lang.Object o)
public static java.lang.Integer jsonLength(java.lang.String input)
public static java.lang.Integer jsonLength(JsonFunctions.JsonValueContext input)
public static java.lang.Integer jsonLength(java.lang.String input, java.lang.String pathSpec)
public static java.lang.Integer jsonLength(JsonFunctions.JsonValueContext input, java.lang.String pathSpec)
public static java.lang.Integer jsonLength(JsonFunctions.JsonPathContext context)
public static java.lang.String jsonKeys(java.lang.String input)
public static java.lang.String jsonKeys(JsonFunctions.JsonValueContext input)
public static java.lang.String jsonKeys(java.lang.String input, java.lang.String pathSpec)
public static java.lang.String jsonKeys(JsonFunctions.JsonValueContext input, java.lang.String pathSpec)
public static java.lang.String jsonKeys(JsonFunctions.JsonPathContext context)
public static java.lang.String jsonRemove(java.lang.String input, java.lang.String... pathSpecs)
public static java.lang.String jsonRemove(JsonFunctions.JsonValueContext input, java.lang.String... pathSpecs)
public static java.lang.Integer jsonStorageSize(java.lang.String input)
public static java.lang.Integer jsonStorageSize(JsonFunctions.JsonValueContext input)
public static boolean isJsonValue(java.lang.String input)
public static boolean isJsonObject(java.lang.String input)
public static boolean isJsonArray(java.lang.String input)
public static boolean isJsonScalar(java.lang.String input)
private static java.lang.RuntimeException toUnchecked(java.lang.Exception e)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.