Skip to main content

Ens.Util.JSON

abstract class Ens.Util.JSON

Method Inventory

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.

Subclasses

FeedbackOpens in a new tab