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 existingJsopTokenizersupport 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
Listof 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 usingRevisions 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 voidappendJsonMap(StringBuilder sb, Map<Object,Object> map)static voidappendJsonMember(StringBuilder sb, String key, Object value)static voidappendJsonString(StringBuilder sb, String s)static voidappendJsonValue(StringBuilder sb, Object value)@Nullable Objectparse(@NotNull String json)Parses the supplied JSON.@Nullable Objectparse(@NotNull JsopTokenizer json)Parses the supplied JSON.
-
-
-
Constructor Detail
-
RDBJSONSupport
public RDBJSONSupport(boolean useRevisionMaps)
- Parameters:
useRevisionMaps- whether to use revision maps instead of regularMaps.
-
-
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)
-
-