A2uiDataPath


class A2uiDataPath


Parses JSON pointer strings (RFC 6901) into segments.

A JSON Pointer is a string syntax for identifying a specific value within a JSON document. This implementation aligns with the A2UI practices, which includes deviations from strict RFC 6901:

  • Empty string "" and "/" both evaluate to the root document (empty segments).

  • A single trailing slash is stripped. (Note: To maintain parsing parity with other A2UI renderers, exactly one trailing slash is removed. e.g., "/foo//" evaluates to "/foo/").

  • Missing leading slashes are permitted and represent relative paths.

Summary

Public constructors

Public functions

operator A2uiDataPath
div(other: A2uiDataPath)

Appends another A2uiDataPath to this path.

operator A2uiDataPath
div(other: String)

Appends a relative path segment other to this path.

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Boolean

True if this path is absolute (starts with '/' or is empty representing root).

String

The normalized, canonical JSON pointer string.

String

The raw JSON pointer string passed during construction.

List<String>

The decoded segments of the JSON pointer.

Public constructors

A2uiDataPath

Added in 1.0.0-alpha01
A2uiDataPath(path: String)

Public functions

div

Added in 1.0.0-alpha01
operator fun div(other: A2uiDataPath): A2uiDataPath

Appends another A2uiDataPath to this path.

If other is absolute, it replaces this path.

Parameters
other: A2uiDataPath

path to append

div

Added in 1.0.0-alpha01
operator fun div(other: String): A2uiDataPath

Appends a relative path segment other to this path.

If other starts with /, it is treated as an absolute path and replaces this path.

Parameters
other: String

segment to append

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

isAbsolute

Added in 1.0.0-alpha01
val isAbsoluteBoolean

True if this path is absolute (starts with '/' or is empty representing root).

normalizedPath

Added in 1.0.0-alpha01
val normalizedPathString

The normalized, canonical JSON pointer string.

path

Added in 1.0.0-alpha01
val pathString

The raw JSON pointer string passed during construction.

segments

Added in 1.0.0-alpha01
val segmentsList<String>

The decoded segments of the JSON pointer.