Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Parser

A parser for parsing JSON pointer string expressions to JSON pointer objects

Hierarchy

  • Parser

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Parser(expression: string): Parser
  • Create a new parser

    throws

    an IllegalArgumentError if the expression is not correctly formatted

    Parameters

    • expression: string

      the expression to be parsed

    Returns Parser

Properties

Private Readonly expression

expression: string

The expression to be parsed

Private pos

pos: number

The current position of the character in the expression

Methods

Private maybeIndex

  • Create an index segment, if the string contains an index.

    The index must be the decimal representation of a positive 32 bit integer without leading 0 or +

    Parameters

    • s: string

    Returns IndexSegment | null

    a new index segment if the string contained an index, otherwise null

next

  • Get the next segment

    Returns Segment | null

    a key segment or an index segment. null if there are no more segments

Private nextSegmentString

  • nextSegmentString(): string
  • Get the next segment string

    Returns string

    a string containing the next segment

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.