Class JsonFunctions
java.lang.Object
org.apache.juneau.commons.svl.functions.JsonFunctions
JSON-navigation functions for the
#{...} script catalog.
All functions accept JSON strings as input and parse on each call via MiniJson. This
is intentionally a per-resolve cost — for repeated lookups against the same JSON document the
caller can pre-compile the surrounding template (VarResolver.compile(String)) so the
tokenization is amortized; the JSON parse itself is not yet cached and is a known follow-on
optimization opportunity.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class#{get(json, key)}— extractsjson[key](object) orjson[index](array, whenkeyparses as int).static class#{jsonPath(json, path)}/#{jsonPath(json, path, default)}— extracts a value via a slash-rooted path (e.g.static class#{keys(json)}— returns a JSON-array-shortcut string of an object's keys.static class#{size(json)}— returns the count: object key count, array length, string length, or0for null/primitives.static class#{values(json)}— returns a JSON-array-shortcut string of an object's values (or array elements). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Class<? extends VarFunction>[]All function classes in this category. -
Method Summary
-
Field Details
-
ALL
All function classes in this category.
-