class %JSON.Formatter
extends %RegisteredObject
%JSON.Formatter implements the ability to format JSON documents which are
expressed as strings, text or dynamic objects.
property Indent
as %Boolean [ InitialExpression = 1 ];
Indent specifies that indentation of the JSON output should take place.
property IndentChars
as %String [ InitialExpression = " " ];
IndentChars specifies the character sequence to be used for each indent level if Indent=1.
property LineTerminator
as %String [ InitialExpression = $char(13,10) ];
LineTerminator specifies the character sequence to terminate each line when indenting.
method Format(input)
as %Status
Format a JSON document using the specified indentation and write it to the current device.
The input argument is either JSON as a string or stream, or a subclass of %DynamicAbstractObject.
method FormatToStream(input, ByRef export As %Stream.Object)
as %Status
Format a JSON document using the specified indentation and write it to a stream.
The input argument is either JSON as a string or stream, or a subclass of %DynamicAbstractObject.
method FormatToString(input, ByRef export As %String = "")
as %Status
Format a JSON document using the specified indentation and write it to a string.
Serialize a JSON enabled class as a JSON document and return it as a string.