Class RDBJSONSupport
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.rdb.RDBJSONSupport
-
public class RDBJSONSupport extends Object
Utilities that provide JSON support on top of the existingJsopTokenizer
support in oak-commons.The result of parsing uses the simplest possible Java representation of the JSON values (see Section 3 of RFC 7159), thus
null
,Boolean.TRUE
,Boolean.FALSE
,Number
, orString
, or- a
List
of representations, or - a
Map
, mapping member names to representations.
The boolean parameter of the constructor ({link
RDBJSONSupport(boolean)
) allows changing the default for the maps to use sorted maps usingRevision
s as keys, as used internally be theDocumentNodeStore
.
-
-
Constructor Summary
Constructors Constructor Description RDBJSONSupport(boolean useRevisionMaps)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
appendJsonMap(StringBuilder sb, Map<Object,Object> map)
static void
appendJsonMember(StringBuilder sb, String key, Object value)
static void
appendJsonString(StringBuilder sb, String s)
static void
appendJsonValue(StringBuilder sb, Object value)
@Nullable Object
parse(@NotNull String json)
Parses the supplied JSON.@Nullable Object
parse(@NotNull JsopTokenizer json)
Parses the supplied JSON.
-
-
-
Constructor Detail
-
RDBJSONSupport
public RDBJSONSupport(boolean useRevisionMaps)
- Parameters:
useRevisionMaps
- whether to use revision maps instead of regularMap
s.
-
-
Method Detail
-
parse
@Nullable public @Nullable Object parse(@NotNull @NotNull String json)
Parses the supplied JSON.
-
parse
@Nullable public @Nullable Object parse(@NotNull @NotNull JsopTokenizer json)
Parses the supplied JSON.
-
appendJsonMember
public static void appendJsonMember(StringBuilder sb, String key, Object value)
-
appendJsonString
public static void appendJsonString(StringBuilder sb, String s)
-
appendJsonMap
public static void appendJsonMap(StringBuilder sb, Map<Object,Object> map)
-
appendJsonValue
public static void appendJsonValue(StringBuilder sb, Object value)
-
-