Class Reference
IRIS for UNIX 2019.4
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%JSON] >  [Generator]
Private  Storage   

abstract class %JSON.Generator

Generator methods for %JSON.Adaptor.

This class is used internally by InterSystems IRIS. You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this class.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
35


Summary

Methods
%JSONGenerate GenExportArray GenExportBinaryStream GenExportCharacterStream
GenExportField GenExportGUID GenExportID GenExportList
GenExportLiteral GenExportOID GenExportObject GenImportArray
GenImportBinaryStream GenImportCharacterStream GenImportField GenImportGUID
GenImportID GenImportList GenImportLiteral GenImportOID
GenImportObject GenWriteField GenerateAllExportInternal GenerateAllImportInternal
GenerateExportInternal GenerateImportInternal GenerateMapping GenerateMappingFromClass
GenerateMappingFromXdata GetMemberInfo JSONExportInternal JSONExportToStringInternal
JSONImportInternal JSONNew LeftSequenceClass


Methods

• classmethod %JSONGenerate(%mode, %class, %property, %method, %parameter, %codemode, %code, %classmodify, %context) as %Status
%JSONGenerate creates thee metadata structure and generates the code for all methods.
• classmethod GenExportArray(class As %String, propertyMap As %List, indent As %String) as %Boolean
Generate code for exporting an array collection value from JSON object of the form {"key":value,...}
• classmethod GenExportBinaryStream(class As %String, propertyMap As %List, fieldName As %String, indent As %String, isCollectionValue As %Integer)
Generate code for exporting a binary stream as JSON.
• classmethod GenExportCharacterStream(class As %String, propertyMap As %List, fieldName As %String, indent As %String, isCollectionValue As %Integer)
Generate code for exporting a character stream as JSON.
• classmethod GenExportField(class As %String, propertyMap As %List, fieldName As %String, indent As %String, isCollectionValue As %Integer) as %Integer
Generate code for exporting a single field value.
• classmethod GenExportGUID(class As %String, propertyMap As %List, fieldName As %String, indent As %String, isCollectionValue As %Integer)
Generate code for exporting an object GUID as JSON.
• classmethod GenExportID(class As %String, propertyMap As %List, fieldName As %String, indent As %String, isCollectionValue As %Integer)
Generate code for exporting an object ID as JSON.
• classmethod GenExportList(class As %String, propertyMap As %List, indent As %String) as %Boolean
Generate code for exporting a List collection as a JSON array.
• classmethod GenExportLiteral(class As %String, propertyMap As %List, fieldName As %String, indent As %String, isCollectionValue As %Integer)
Generate code for exporting a literal value as JSON.
• classmethod GenExportOID(class As %String, propertyMap As %List, fieldName As %String, indent As %String, isCollectionValue As %Integer)
Generate code for exporting an object OID as JSON.
• classmethod GenExportObject(class As %String, propertyMap As %List, fieldName As %String, indent As %String, isCollectionValue As %Integer)
Generate code for exporting a referenced object as JSON.
• classmethod GenImportArray(class As %String, propertyMap As %List, indent As %String) as %Boolean
Generate code for importing an array value from JSON object of the form {"key":value,...}
• classmethod GenImportBinaryStream(class As %String, propertyMap As %List, indent As %String, isCollectionValue As %Integer)
Generate code for getting the field value from a binary stream and storing in variable named data.
• classmethod GenImportCharacterStream(class As %String, propertyMap As %List, indent As %String, isCollectionValue As %Integer)
Generate code for getting the field value from a character stream and storing in variable named data.
• classmethod GenImportField(class As %String, propertyMap As %List, indent As %String, isCollectionValue As %Integer) as %Boolean
Generate code for importing a single field value.
• classmethod GenImportGUID(class As %String, propertyMap As %List, indent As %String, isCollectionValue As %Integer)
Generate code for importing an object GUID and storing the object reference in variable named data.
• classmethod GenImportID(class As %String, propertyMap As %List, indent As %String, isCollectionValue As %Integer)
Generate code for importing an object ID and storing the object reference in variable named data.
• classmethod GenImportList(class As %String, propertyMap As %List, indent As %String) as %Boolean
Generate code for importing a JSON array as a List collection.
• classmethod GenImportLiteral(class As %String, propertyMap As %List, indent As %String, isCollectionValue As %Integer)
Generate code for getting the field value and storing in variable named data.
• classmethod GenImportOID(class As %String, propertyMap As %List, indent As %String, isCollectionValue As %Integer)
Generate code for importing an object OID and storing the object reference in variable named data.
• classmethod GenImportObject(class As %String, propertyMap As %List, indent As %String, isCollectionValue As %Integer)
Generate code for importing a referenced object and storing in variable named data.
• classmethod GenWriteField(fieldName As %String, indent As %String, valueText As %String)
Generate code to write out the field name and value
• classmethod GenerateAllExportInternal(class As %String, ByRef mapping As %String, useWrite As %Boolean) as %Status
Generate the code for the %JSONExportInternal method
• classmethod GenerateAllImportInternal(class As %String, ByRef mapping As %String) as %Status
Generate the code for the %JSONImportInternal method
• classmethod GenerateExportInternal(class As %String, indent As %String, mappingName As %String, ByRef mapping As %String) as %Status
Generate the code for the specified mapping of %JSONExportInternal method
• classmethod GenerateImportInternal(class As %String, indent As %String, mappingName As %String, ByRef mapping As %String, ByRef needRequired As %Boolean, ByRef needTestInvalidField As %Boolean) as %Status
Generate the code for the %JSONImportInternal method for the specified mappingName.
• classmethod GenerateMapping(class As %String, Output mapping) as %Status
• classmethod GenerateMappingFromClass(class As %String, name As %String, obj As %JSON.Mapping, ByRef mapping) as %Status
Generate mapping based on imported configuration info from Xdata block
• classmethod GenerateMappingFromXdata(class As %String, ByRef mapping) as %Status
Get the JSON adaptor configuration information from class and property parameters.
• classmethod GetMemberInfo(class As %String, property As %String, ByRef includeProperty As %Boolean, Output type As %String, Output membercat As %String)
Return member type information about a property
includeProperty is set if passed in as "" which means not specified
member cat is defined by
    = "LITERAL" | "OBJPERSISTENT" | "OBJSERIAL" | "OBJREGISTERED" | "CSTREAM" | "BSTREAM"
   If RELATIONSHIP MANY|CHILDREN, then ListCollectionOBJPERSISTENT
   If List Of, then { ArrayCollection | ListCollection } 
   If %ListOf... or %ArrayOf... { ArrayCollection | ListCollection } 
   Otherwis 
type is the type referenced by the property.
• classmethod JSONExportInternal(%mode, %class, %property, %method, %parameter, %codemode, %code, %classmodify, %context) as %Status
Get the code for the %JSONExportInternal method to actually do the method generation
• classmethod JSONExportToStringInternal(%mode, %class, %property, %method, %parameter, %codemode, %code, %classmodify, %context) as %Status
Get the code for the %JSONExportToStringInternal method to actually do the method generation
• classmethod JSONImportInternal(%mode, %class, %property, %method, %parameter, %codemode, %code, %classmodify, %context) as %Status
Get the code for the %JSONImportInternal method to actually do the method generation
• classmethod JSONNew(%mode, %class, %property, %method, %parameter, %codemode, %code, %classmodify, %context) as %Status
• classmethod LeftSequenceClass(class As %String, ByRef seqArray)
Return all super classes in sequence of left to right with super class immediately following its child.


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