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

class %JSON.Formatter extends %RegisteredObject

%JSON.Formatter implements the ability to format JSON documents which are expressed as strings, text or dynamic objects.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
3 4


Summary

Properties
Indent IndentChars LineTerminator

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
Format FormatToStream FormatToString


Properties

• 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.

Methods

• 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.


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