Class Reference
IRIS for UNIX 2024.1.2
InterSystems: The power behind what matters   
Documentation  Search
  [USER] >  [Ens] >  [Util] >  [JSON]
Private  Storage   

abstract class Ens.Util.JSON

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
5


Summary

Methods
JSONStreamToObject JSONStreamToObjectArray ObjectToJSONStream altJSONStreamToObject
altJSONStreamToObjectArray

Subclasses
EnsLib.REST.Operation EnsLib.REST.Service

Methods

• classmethod JSONStreamToObject(pStream, Output pObject As %RegisteredObject, pClass As %String, pIgnoreUnknownProps As %Boolean) as %Status
This method calls the legacy %ZEN.Auxiliary.jsonProvider method %ParseJSON. The JSON parsing correlates the first JSON string to correlate to the object returned. It does require the stream to begin with either a [ or {. It does not error if there is other text in the stream after the first identified JSON string. It will return a null object and no error if the {} or [] cannot be parsed e.g. an = is used instead of a : It also tolerates, for example, JSON properties that are not enclosed in double quotes.
• classmethod JSONStreamToObjectArray(pStream, Output pArray, pClass As %String, pIgnoreUnknownProps As %Boolean) as %Status
This method calls the legacy %ZEN.Auxiliary.jsonProvider method %ParseJSON. The JSON parsing correlates the first JSON string to the object returned. It does require the stream to begin with either a [ or {. It does not error if there is other text in the stream after the first identified JSON string. It will return a null object and no error if the {} or [] cannot be parsed e.g. an = is used instead of a : It also tolerates, for example, JSON properties that are not enclosed in double quotes.
• classmethod ObjectToJSONStream(pObject As %RegisteredObject, ByRef pStream, pFormat As %String = "iw") as %Status
This method calls the legacy %ZEN.Auxiliary.jsonProvider::%WriteJSONStreamFromObject in order to support formatting options such as "iw"
• classmethod altJSONStreamToObject(pStream, Output pObject As %RegisteredObject, pClass As %String, pIgnoreUnknownProps As %Boolean) as %Status
This method calls the %ZEN.Auxiliary.altJSONProvider method %ParseJSON. Notes include: this method assumes well-formed JSON notation for a single JSON string representation and uses the system level dynamic objects parsing code. It also requires, for example, properties to be enclosed in double quotes. It does not perform complete error checking.
• classmethod altJSONStreamToObjectArray(pStream, Output pArray, pClass As %String, pIgnoreUnknownProps As %Boolean) as %Status
This method calls the %ZEN.Auxiliary.altJSONProvider method %ParseJSON. Notes include: this method assumes well-formed JSON notation for a single JSON string representation and uses the system level dynamic objects parsing code. It also requires, for example, properties to be enclosed in double quotes. It does not perform complete error checking.


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.