HS.JSON.Adaptor

abstract class HS.JSON.Adaptor

Adds specialized JSON capabilities to classes.

Method Inventory

Parameters

parameter JSONIDFIELD;
Name of field in emitted JSON that holds the object's ID field (i.e. returned from ..%Id()). If this field is not defined, or if the class is not persistent, the value is not emitted.
parameter JSONSHOWEMPTY = 1;
If true, emit JSON for empty (non-collection) properties.
parameter JSONTYPEFIELD = _class;
Name of field in emitted JSON that holds the type (classname) for objects.

Methods

method %CreateProxy(Output pObj As %ZEN.proxyObject) as %Status
Create a proxy object and copy this object's values into it. This is an alternate way to create JSON content.
JSONSHOWEMPTY is ignored.
classmethod %GetJSONType() as %String
Return the value to be used within the JSONTYPEFIELD.
classmethod %StreamToJSON(pStream As %Stream, pBase64 As %Boolean = 0) as %Status
Utility method. Write out the contents of the given stream as a JSON value.
method %ToJSON(pLevel As %Integer = 0, pFormat As %String = "aelotw") as %Status
Write out this object's current value as JSON content. pFormat is ignored; it is only there for compatability with the %ZEN.proxyObject %ToJSON method.

Subclasses

Feedback