Options
All
  • Public
  • Public/Protected
  • All
Menu

Class JsonParser<T>

JsonParser provides functionality for reading JSON. It is also highly customizable to work both with different styles of JSON content, and to support more advanced Object concepts such as polymorphism and Object identity.

Type parameters

  • T

Hierarchy

  • JsonParser

Index

Constructors

constructor

Properties

defaultContext

defaultContext: JsonParserContext

Default context to use during deserialization.

getMetadataCache

getMetadataCache: Map<Record<string, any>, Map<string, Map<string, any>>> = new Map()

Cache getMetadataCache

metadataKeysIncludingCache

metadataKeysIncludingCache: Map<Record<string, any>, Map<string, any>> = new Map()

Methods

parse

  • Method for deserializing a JSON string into a JavaScript object or value.

    Parameters

    • text: string

      the JSON string to be deserialized.

    • Optional context: JsonParserContext

      the context to be used during deserialization.

    Returns T

transform

  • Method for applying json decorators to a JavaScript object/value parsed. It returns a JavaScript object/value with json decorators applied.

    Parameters

    • value: any

      the JavaScript object or value to be postprocessed.

    • Optional context: JsonParserContext

      the context to be used during deserialization postprocessing.

    Returns any

Static makeDefaultContext

Static mergeContexts

Generated using TypeDoc