Interface Selector
- All Known Implementing Classes:
Selector.Filter, Selector.Index, Selector.Name, Selector.Slice, Selector.Wildcard
public sealed interface Selector
permits Selector.Name, Selector.Wildcard, Selector.Index, Selector.Slice, Selector.Filter
A selector in a segment (RFC 9535, Section 2.3). A selector selects zero or more children of a node.
| Selector | Query text | Selects from {"a": [10, 20, 30]}, at $.a |
|---|---|---|
Selector.Name |
$['a'], $.a |
the array (from the root) |
Selector.Wildcard |
$.a[*], $.a.* |
10, 20, 30 |
Selector.Index |
$.a[1], $.a[-1] |
20; 30 |
Selector.Slice |
$.a[0:2], $.a[::-1] |
10, 20; 30, 20, 10 |
Selector.Filter |
$.a[?@ > 15] |
20, 30 |
A selector that does not apply to a node selects nothing. It is not an error. For example, an index selector selects nothing from an object, or from an array that is too short.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA filter selector:?<logical-expr>(Section 2.3.5).static final recordAn index selector (Section 2.3.3).static final recordA name selector:'name'or"name"(Section 2.3.1).static final recordAn array slice selector:start:end:step(Section 2.3.4).static final recordThe wildcard selector:*(Section 2.3.2).