Skip to main content

%DataModel.Serializer

Class %DataModel.Serializer [ Abstract ]

Likely this will need to be an AET populated with property values that are AE's that wrap Registered counterparts.

Methods

fromJson

ClassMethod fromJson(str) As %RegisteredObject

Immutable universal wrapper for populating an instance of a registered object via a JSON representation of its data. This method calls %FromJSONValue(), which may be overridden, to perform the actual business of JSON parsing and object population

projectArrayFromCollection

ClassMethod projectArrayFromCollection(target, source, laxMode As %Integer = 1)

This is an internal class that implements utilities used by the $project methods. These utility methods are implemented here but represent %ToObject and %FromObject implementations for various system classes, including collection classes, %ZEN.proxyObject, and so on.
The top level composition methods accept a target instance and that instance will be populated by the projectrs. These methods are all named projectSomething.
The lower level methods map an instance of something to an instance of something else. The method is specific for each category of from object and to object. For example, to map a Cache Object to an Array, the method is named mapCacheObjectToArray. The various map methods accept a target and if target is null then it is populated with the To object type.

projectArrayFromRegistered

ClassMethod projectArrayFromRegistered(target, source, laxMode As %Integer = 1)

projectObjectFromCollection

ClassMethod projectObjectFromCollection(target, source, laxMode As %Integer = 1)

This is the top level of composition - a top level object requested to be projectd from a source instance. Construct the AET.

projectCollectionFromCollection

ClassMethod projectCollectionFromCollection(target, source, laxMode As %Integer = 1)

projectObjectFromRegistered

ClassMethod projectObjectFromRegistered(target, source, laxMode As %Integer = 1)

This is the top level of composition - a top level object requested to be projectd from a source instance. Construct the AET.

projectRegisteredFromAbstractObject

ClassMethod projectRegisteredFromAbstractObject(target, source, laxMode As %Integer = 1)

target is an instance of the RegisteredObject class, source is a DAO

projectZPOFromAbstractObject

ClassMethod projectZPOFromAbstractObject(target, source, laxMode As %Integer = 1)

projectRegisteredFromRegistered

ClassMethod projectRegisteredFromRegistered(target, source, laxMode As %Integer = 1)

projectCollectionFromAbstractObject

ClassMethod projectCollectionFromAbstractObject(target, source, laxMode As %Integer = 1)

projectListFromDao

ClassMethod projectListFromDao(target, source, laxMode As %Integer = 1)

projectListFromRegistered

ClassMethod projectListFromRegistered(target, source, laxMode As %Integer = 1)

mapGenericObjectToAbstractObject

ClassMethod mapGenericObjectToAbstractObject(source As %RawString, target As %Library.DynamicAbstractObject = "", laxMode As %Integer = 1, asReference As %Integer = 1, nested As %Integer = 0) As %Library.DynamicAbstractObject

This mapper accepts any object (oref) and returns an %AbstractObject. This is just a dispatcher that invokes the most reasonable mapper depending on the type information gathered from the source object.

mapRegisteredToObject

ClassMethod mapRegisteredToObject(source As %Library.RegisteredObject, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicObject

mapPersistentToObject

ClassMethod mapPersistentToObject(source As %Library.SerialObject, target As %Library.DynamicObject = "", laxMode As %Integer = 1, asReference As %Integer = 1, nested As %Integer = 0) As %Library.DynamicObject

mapOIDToObject

ClassMethod mapOIDToObject(className As %RawString = "", propertyName As %RawString = "", typeClass As %RawString = "", oid As %RawString = "", target As %Library.DynamicObject = "") As %Library.DynamicObject

mapSerialToObject

ClassMethod mapSerialToObject(source As %Library.SerialObject, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicObject

mapCollectionToObject

ClassMethod mapCollectionToObject(source As %Collection.AbstractIterator, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicObject

This is a generic collection dispatcher - Cache Objects collection type is either list or array

mapListCollectionToObject

ClassMethod mapListCollectionToObject(source As %Collection.AbstractList, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicObject

mapArrayCollectionToObject

ClassMethod mapArrayCollectionToObject(source As %Collection.AbstractArray, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicObject

mapStreamToObject

ClassMethod mapStreamToObject(source As %Library.SerialObject, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicObject

mapZPOToObject

ClassMethod mapZPOToObject(source As %ZEN.proxyObject, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicObject [ Internal ]

mapCollectionToArray

ClassMethod mapCollectionToArray(source As %Collection.AbstractIterator, target As %Library.DynamicArray = "", laxMode As %Integer = 1) As %Library.DynamicArray

This is a generic collection dispatcher - Cache Objects collection type is either list or array

mapListCollectionToArray

ClassMethod mapListCollectionToArray(source As %Collection.AbstractList, target As %Library.DynamicArray = "", laxMode As %Integer = 1) As %Library.DynamicArray

mapListCollectionToRegistered

ClassMethod mapListCollectionToRegistered(source As %Collection.AbstractList, target As %Library.DynamicArray = "", laxMode As %Integer = 1) As %Library.RegisteredObject

mapArrayCollectionToArray

ClassMethod mapArrayCollectionToArray(source As %Collection.AbstractArray, target As %Library.DynamicArray = "", laxMode As %Integer = 1) As %Library.DynamicArray

mapArrayCollectionToRegistered

ClassMethod mapArrayCollectionToRegistered(source As %Collection.AbstractList, target As %Library.DynamicArray = "", laxMode As %Integer = 1) As %Library.RegisteredObject

mapPersistentToArray

ClassMethod mapPersistentToArray(source As %Library.RegisteredObject, target As %Library.RegisteredObject = "", laxMode As %Integer = 1, asReference As %Integer = 1) As %Library.RegisteredObject

mapRegisteredToArray

ClassMethod mapRegisteredToArray(source As %Library.RegisteredObject, target As %Library.RegisteredObject = "", laxMode As %Integer = 1, asReference As %Integer = 1) As %Library.RegisteredObject

mapRelationshipToArray

ClassMethod mapRelationshipToArray(source As %Collection.AbstractList, target As %Library.DynamicArray = "", laxMode As %Integer = 1) As %Library.DynamicArray

An N-Cardinality relationship has an interface consistent with a Cache Array Collection but there are differences. This mapper function

mapStreamToArray

ClassMethod mapStreamToArray(source As %Library.SerialObject, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicArray

mapZPOToArray

ClassMethod mapZPOToArray(source As %ZEN.proxyObject, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicArray [ Internal ]

mapObjectToRegistered

ClassMethod mapObjectToRegistered(source As %Library.DynamicObject, target As %Library.RegisteredObject = "", laxMode As %Integer = 1, asReference As %Integer = 1) As %Library.RegisteredObject

mapObjectToZPO

ClassMethod mapObjectToZPO(source As %Library.DynamicObject, target As %ZEN.proxyObject = "", laxMode As %Integer = 1) As %ZEN.proxyObject [ Internal ]

mapArrayToZPO

ClassMethod mapArrayToZPO(source As %Library.DynamicArray, target As %Library.ListOfDataTypes = "", laxMode As %Integer = 1) As %Library.ListOfDataTypes [ Internal ]

mapAbstractObjectToArrayCollection

ClassMethod mapAbstractObjectToArrayCollection(source As %Library.DynamicArray, target As %Collection.AbstractArray = "", laxMode As %Integer = 1, asReference As %Integer = 1) As %Collection.AbstractArray

mapAbstractObjectToListCollection

ClassMethod mapAbstractObjectToListCollection(source As %Library.DynamicArray, target As %Collection.AbstractArray = "", laxMode As %Integer = 1, asReference As %Integer = 1) As %Collection.AbstractArray

mapRegisteredToRegistered

ClassMethod mapRegisteredToRegistered(source As %Library.RegisteredObject, target As %Library.RegisteredObject = "", laxMode As %Integer = 1, asReference As %Integer = 1) As %Library.RegisteredObject

mapStreamToRegistered

ClassMethod mapStreamToRegistered(source As %Library.SerialObject, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.RegisteredObject

mapReferenceToValue

ClassMethod mapReferenceToValue(source As %Library.Persistent, target As %Library.DynamicObject = "", laxMode As %Integer = 1) As %Library.DynamicObject

Return an object containing the class name and ID of a Persistent instance

getObjectProperties

ClassMethod getObjectProperties(oref As %Library.ObjectHandle = "", ByRef properties As %RawString) As %Integer [ Internal ]

getPropertyMetadata

ClassMethod getPropertyMetadata(class As %String(MAXLEN=""), propertyDescriptor As %String(MAXLEN=""), Output swizzleable As %Integer = 0, Output category As %String(MAXLEN="") = "", Output collectionType As %String(MAXLEN="") = "", Output multiDimensional As %Integer = 0, ByRef relationship As %Integer = 0, ByRef cardinality As %String(MAXLEN=6) = "", ByRef type As %String(MAXLEN="") = "", Output runtimeType As %String(MAXLEN="") = "", Output extGet As %Integer = 0, Output extSet As %Integer = 0) [ Internal ]

getValue

ClassMethod getValue(oref, pd, Output value) As %Integer

Returns the value of the property from the property descriptor because the current value may be multidimensional and we need to pass back an array with structure

setValue

ClassMethod setValue(oref, pd, ByRef value) As %Integer

getJSONType

ClassMethod getJSONType(class) As %String

fromObject

ClassMethod fromObject(source As %RegisteredObject = "", returnValue = "", laxMode As %Integer = 1) [ Internal ]

%FromJSONValue

ClassMethod %FromJSONValue(str) As %RegisteredObject [ ServerOnly = 1 ]

Default mechanism for populating an instance of this object from a JSON representation of its data.

%FromObject

ClassMethod %FromObject(source = "", target = "", laxMode As %Integer = 1) As %RegisteredObject [ ServerOnly = 1 ]

Default mechanism for populating an instance of this object from an instance of some other object. This method is responsible for identifying the type of the source object and processing the mapping from that source to the target object. If the target instance is not populated then this method is responsible for instantiating the current class and returning that instance to the caller. ]]>