SelectedNode

One node of a SelectResult. Readable while its result is open.

Properties

Link copied to clipboard
abstract val node: NodeRef

The node.

Link copied to clipboard
abstract val path: String

Where the node is, as an RFC 9535 Normalized Path (SPEC.md §9.3) whose $ is the value the query started at: $['items'][0].

Functions

Link copied to clipboard
open fun readJsonAsString(maxChars: Int): String

The node as a JSON string; throws ResultTooLargeException if it has more than maxChars characters.

abstract fun readJsonAsString(format: JsonFormat, maxChars: Int): String

The node as a JSON string laid out in format; throws ResultTooLargeException if the text has more than maxChars characters, its whitespace included.

Link copied to clipboard
open fun writeJsonTo(out: OutputStream)

Writes the node as JSON (SPEC.md §5) with memory independent of its size. Doesn't close out.

abstract fun writeJsonTo(out: OutputStream, format: JsonFormat)

Writes the node as JSON laid out in format (SPEC.md §5.1) with memory independent of its size. Doesn't close out.