use of org.jooq.impl.Tools.CTX in project jOOQ by jOOQ.
the class DefaultParseContext method parseFieldJSONLiteralIf.
private final Field<?> parseFieldJSONLiteralIf() {
if (parseKeywordIf("JSON")) {
if (parseIf('{')) {
if (parseIf('}'))
return jsonObject();
List<JSONEntry<?>> entries = parseList(',', ctx -> {
Field key = parseField();
parse(':');
return key(key).value(parseField());
});
parse('}');
return jsonObject(entries);
} else if (parseIf('[')) {
if (parseIf(']'))
return jsonArray();
List<Field<?>> fields = parseList(',', c -> parseField());
parse(']');
return jsonArray(fields);
} else
throw expected("[", "{");
}
return null;
}
Aggregations