A2uiDataPath


public final 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 methods

final @NonNull A2uiDataPath

Appends another A2uiDataPath to this path.

final @NonNull A2uiDataPath
div(@NonNull String other)

Appends a relative path segment other to this path.

boolean
equals(Object other)
final @NonNull String

The normalized, canonical JSON pointer string.

final @NonNull String

The raw JSON pointer string passed during construction.

final @NonNull List<@NonNull String>

The decoded segments of the JSON pointer.

int
final boolean

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

@NonNull String

Public constructors

A2uiDataPath

Added in 1.0.0-alpha01
public A2uiDataPath(@NonNull String path)

Public methods

div

Added in 1.0.0-alpha01
public final @NonNull A2uiDataPath div(@NonNull A2uiDataPath other)

Appends another A2uiDataPath to this path.

If other is absolute, it replaces this path.

Parameters
@NonNull A2uiDataPath other

path to append

div

Added in 1.0.0-alpha01
public final @NonNull A2uiDataPath div(@NonNull String other)

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
@NonNull String other

segment to append

equals

public boolean equals(Object other)

getNormalizedPath

Added in 1.0.0-alpha01
public final @NonNull String getNormalizedPath()

The normalized, canonical JSON pointer string.

getPath

Added in 1.0.0-alpha01
public final @NonNull String getPath()

The raw JSON pointer string passed during construction.

getSegments

Added in 1.0.0-alpha01
public final @NonNull List<@NonNull StringgetSegments()

The decoded segments of the JSON pointer.

hashCode

public int hashCode()

isAbsolute

Added in 1.0.0-alpha01
public final boolean isAbsolute()

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

toString

public @NonNull String toString()