Namespace: OpenEdge.Core.Json
Class
JsonSerializer
Parent classes:
Progress.Lang.Object

Inherits: Progress.Lang.Object

/* *************************************************************************************************************************
Copyright (c) 2019-2020 by Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
File:OpenEdge.Core.Json.JsonSerializer
Description:Serilaizes to and from JSON
Author(s):pjudge
Created:2019-11-21
/* Default constructor.
This is private so that this class cannot be instantiated - it's intended to be used with static members only




Method Summary
Options Name Purpose
Progress.Lang.Object Deserialize (JsonArray) /* Deserializes an array of object from a JSON array.. Integer values are references to objects in the array - if there are duplicates then only one has to be (de)serialised. References must be 'backwards' (ie to an already-deserialised object). @param JsonArray An array represented as JSON @return Progress.Lang.Object[] A deserialised object array */
Progress.Lang.Object Deserialize (JsonObject) /* Deserializes this object from JSON. @param JsonConstruct This object represented as JSON @return Progress.Lang.Object A deserialised object */
Progress.Lang.Object NewSerializableObject (Class) /* Instantiates a new instance of an IJsonSerializable object. This method attempts to find a service using the CCS Service Manager, using IJsonSerializable as the service name, and the type name as an alias. If none foudn or returned, then the method requires that the type implement IJsonSerializable, be NEW'able (not abstract and not an interface) and also have a public default constructor. @param Progress.Lang.Class The type to instantiate @return Progress.Lang.Object An object of that type */
Progress.Json.ObjectModel.JsonObject Serialize (Object) /* Serialises an object to JSON. This method first tries to serialize using OpenEdge.Core.Json.IJsonSerializer and then Progress.IO.JsonSerializer. If the class implements neither then an invalid object is returned. If the class implements IJsonSerializer then the JSON returned has the format { "serializer": <STRING> // OOABL type name of the IJsonSerializer interface "object": <STRING> // OOABL type name of the object being serialised "data": <NULL|OBJECT|ARRAY> // the serialized object data } If the class uses the built-in serilisation, then the JSON format is { "prods:version": <VERISON>, "prods:objId", <internal ID of this object)> "<STRING>" : { // the string is the OOABL type name of the class bening serialised // serialisation data, per doc } } @param Progress.Lang.Object The object to serialize @return JsonObject The JSON data. May be invalid/unknown */
Progress.Json.ObjectModel.JsonArray Serialize (Object[]) /* Serialises an array of objects to JSON. This method first tries to serialize using OpenEdge.Core.Json.IJsonSerializer and then Progress.IO.JsonSerializer. If the class implements neither then an invalid object is returned. If there are duplicate objects in the array, then the index of the duplicate object is written @param Progress.Lang.Object[] The objects to serialize @return JsonArray The JSON data. May be invalid/unknown */

Constructor Summary
Options Name Purpose
JsonSerializer () /* Default constructor. This is private so that this class cannot be instantiated - it's intended to be used with static members only */


Method Detail
Top

Progress.Lang.Object Deserialize (JsonArray)

/* Deserializes an array of object from a JSON array..
Integer values are references to objects in the array - if there are duplicates
then only one has to be (de)serialised. References must be 'backwards' (ie to an
already-deserialised object).
Parameters:
pJson Progress.Json.ObjectModel.JsonArray
Returns Progress.Lang.Object
Progress.Lang.Object[] A deserialised object array
Top

Progress.Lang.Object Deserialize (JsonObject)

/* Deserializes this object from JSON.
Parameters:
pJson Progress.Json.ObjectModel.JsonObject
Returns Progress.Lang.Object
Progress.Lang.Object A deserialised object
Top

Progress.Lang.Object NewSerializableObject (Class)

/* Instantiates a new instance of an IJsonSerializable object.
This method attempts to find a service using the CCS Service Manager, using IJsonSerializable as
the service name, and the type name as an alias.
If none foudn or returned, then the method requires that the type implement IJsonSerializable, be NEW'able
(not abstract and not an interface) and also have a public default constructor.
Parameters:
pType Progress.Lang.Class
Returns Progress.Lang.Object
Progress.Lang.Object An object of that type
Top

Progress.Json.ObjectModel.JsonObject Serialize (Object)

/* Serialises an object to JSON.
This method first tries to serialize using OpenEdge.Core.Json.IJsonSerializer and
then Progress.IO.JsonSerializer. If the class implements neither then an invalid object
is returned.
If the class implements IJsonSerializer then the JSON returned has the format
{
"serializer": <STRING> // OOABL type name of the IJsonSerializer interface
"object": <STRING> // OOABL type name of the object being serialised
"data": <NULL|OBJECT|ARRAY> // the serialized object data
}
If the class uses the built-in serilisation, then the JSON format is
{
"prods:version": version": <VERISON>,
"prods:objId", objId", <internal ID of this object)>
"<STRING>" : { // the string is the OOABL type name of the class bening serialised
// serialisation data, per doc
}
}
Parameters:
pSerialize Progress.Lang.Object
Returns Progress.Json.ObjectModel.JsonObject
JsonObject The JSON data. May be invalid/unknown
Top

Progress.Json.ObjectModel.JsonArray Serialize (Object[])

/* Serialises an array of objects to JSON.
This method first tries to serialize using OpenEdge.Core.Json.IJsonSerializer and
then Progress.IO.JsonSerializer. If the class implements neither then an invalid object
is returned.
If there are duplicate objects in the array, then the index of the duplicate object is written
Parameters:
pSerialize Progress.Lang.Object
Returns Progress.Json.ObjectModel.JsonArray
JsonArray The JSON data. May be invalid/unknown


Constructor Detail
Top

JsonSerializer ()

/* Default constructor.
This is private so that this class cannot be instantiated - it's intended to be used with static members only


Copyright © 2022 Progress Software Corporation. All rights Reserved.

Progress® OpenEdge® Release 11.7.15