Class RDBJSONSupport
java.lang.Object
org.apache.jackrabbit.oak.plugins.document.rdb.RDBJSONSupport
Utilities that provide JSON support on top of the existing
JsopTokenizer
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 using Revision
s as keys, as used internally be the
DocumentNodeStore
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Parses the supplied JSON.@Nullable Object
parse
(@NotNull JsopTokenizer json) Parses the supplied JSON.
-
Constructor Details
-
RDBJSONSupport
public RDBJSONSupport(boolean useRevisionMaps) - Parameters:
useRevisionMaps
- whether to use revision maps instead of regularMap
s.
-
-
Method Details
-
parse
Parses the supplied JSON. -
parse
Parses the supplied JSON. -
appendJsonMember
-
appendJsonString
-
appendJsonMap
-
appendJsonValue
-