Class JSONUtil
java.lang.Object
org.infinispan.server.resp.json.JSONUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.jayway.jsonpath.Configurationstatic final com.jayway.jsonpath.Configurationstatic final com.jayway.jsonpath.Configurationstatic final com.jayway.jsonpath.Configurationstatic final com.jayway.jsonpath.Configurationstatic byte[]static final com.fasterxml.jackson.databind.ObjectMapperstatic com.jayway.jsonpath.ParseContextstatic com.jayway.jsonpath.ParseContextstatic com.jayway.jsonpath.ParseContextstatic com.jayway.jsonpath.ParseContextstatic com.jayway.jsonpath.ParseContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertRedisFilterToJayway(String redisFilter) Converts any RedisJSON-style =~ "regex" fragments into Jayway =~ /regex/ format.static booleanisJsonPath(byte[] path) static booleanisJsonPath(String path) static booleanisRoot(byte[] path) static booleanisValueInvalid(byte[] value) static byte[]toJsonPath(byte[] path) Returns a jsonpath version of path with Redis regex patterns converted to Jayway format.static StringtoJsonPath(String path) Returns a jsonpath version of path with Redis regex patterns converted to Jayway format.
-
Field Details
-
JSON_ROOT
public static byte[] JSON_ROOT -
objectMapper
public static final com.fasterxml.jackson.databind.ObjectMapper objectMapper -
configForDefiniteSet
public static final com.jayway.jsonpath.Configuration configForDefiniteSet -
parserForDefiniteSet
public static com.jayway.jsonpath.ParseContext parserForDefiniteSet -
configForSet
public static final com.jayway.jsonpath.Configuration configForSet -
parserForSet
public static com.jayway.jsonpath.ParseContext parserForSet -
configForGet
public static final com.jayway.jsonpath.Configuration configForGet -
parserForGet
public static com.jayway.jsonpath.ParseContext parserForGet -
configForMod
public static final com.jayway.jsonpath.Configuration configForMod -
parserForMod
public static com.jayway.jsonpath.ParseContext parserForMod -
configForDefiniteMod
public static final com.jayway.jsonpath.Configuration configForDefiniteMod -
parserForDefiniteMod
public static com.jayway.jsonpath.ParseContext parserForDefiniteMod
-
-
Constructor Details
-
JSONUtil
public JSONUtil()
-
-
Method Details
-
isRoot
public static boolean isRoot(byte[] path) -
toJsonPath
Returns a jsonpath version of path with Redis regex patterns converted to Jayway format. This method performs two conversions in order: 1. Legacy path format conversion (e.g., ".foo" → "$.foo") 2. Redis regex format conversion on the result (e.g., =~ "pattern" → =~ /pattern/)- Parameters:
path- the path as a String- Returns:
- path converted to Jayway-compatible JSONPath format
-
toJsonPath
public static byte[] toJsonPath(byte[] path) Returns a jsonpath version of path with Redis regex patterns converted to Jayway format. This is a convenience method that converts byte[] to String, performs the conversions, and returns the result as byte[].- Parameters:
path- the path as byte[]- Returns:
- path converted to Jayway-compatible JSONPath format as byte[]
-
isJsonPath
public static boolean isJsonPath(byte[] path) -
isJsonPath
-
isValueInvalid
public static boolean isValueInvalid(byte[] value) -
convertRedisFilterToJayway
-