Namespace: Consultingwerk.Util
Class 
JsonHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:JsonHelper
Purpose:Helper class for handling Json Objects
Author(s):Mike Fechner / Consultingwerk
Created:Wed May 18 17:29:44 CEST 2016



Top Method Summary
Options Name Purpose
+ Consultingwerk.JsonDataTypeEnum AblDataTypeToJsonDataTypeEnum (character) Returns the JSON Type for the given ABL Data Type
+ AddBufferFields (handle, JsonObject, character) Adds the given fields of a buffer to an JSON Object
+ Progress.Json.ObjectModel.JsonArray AddNewJsonArray (JsonObject, character) Adds a new JsonArray to the given JsonObject
+ Progress.Json.ObjectModel.JsonObject AddNewJsonObject (JsonObject, character) Adds a new JsonObject to the given JsonObject
+ AddObjectPropertiesToJson (Object, JsonObject, character) Adds the properties of the given ABL Object to the JSON Object
+ AddObjectPropertiesToJsonArray (Object, JsonArray, character, character, character) Adds the properties of the given ABL Object to the JSON Array as name/value pairs
+ AddObjectPropertiesToJsonArray (Object, JsonArray, character, character, character, character) Adds the properties of the given ABL Object to the JSON Array as name/value pairs
+ AddWidgetPropertiesToJsonArray (handle, JsonArray, character, character, character) Adds the properties of the given widget to the JSON Array as name/value pairs
+ AssignBufferFieldFromJson (handle, JsonObject) Assigns fiels of the buffer from the values of the JSON object
+ AssignBufferFromJson (handle, JsonObject, character, character) Assigns fiels of the buffer from the values of the JSON object
+ AssignJsonObjectPropertiesFromString (JsonObject, character) Assigns properties in the given JsonObject from a Character value
+ CHARACTER AttributeValueList (JsonArray, character) Builds a Character list of the property values in all objects of the array
+ CHARACTER AttributeValueList (JsonArray, character, character) Builds a Character list of the property values in all objects of the array
+ CopyProperties (JsonObject, JsonObject, character) Copies the given JSON Properties from the source JSON to the targegt JSON
+ EnsureCharacterProperty (JsonObject, character) Ensures that a primitive JSON property is a character
+ CHARACTER ExactPropertyName (JsonObject, character) Returns the property name if found in the JSON object in the exact case as it appears in the JSON object
+ Progress.Json.ObjectModel.JsonObject FindJsonObjectWithArrayValue (JsonArray, character, integer) Locates the JsonObject from a JsonArray with the requested integer value in a JsonArray property
+ Progress.Json.ObjectModel.JsonObject FindJsonObjectWithPropertyValue (JsonArray, character, character) Locates the JsonObject from a JsonArray with the requested character property value
+ Progress.Json.ObjectModel.JsonObject FindJsonObjectWithPropertyValue (JsonArray, character, integer) Locates the JsonObject from a JsonArray with the requested integer property value
+ Progress.Json.ObjectModel.JsonObject FromDataset (handle) Returns the JSON Object with the contents of the given ProDataset
+ Progress.Json.ObjectModel.JsonObject FromDataset (handle, logical) Returns the JSON Object with the contents of the given ProDataset
+ Progress.Json.ObjectModel.JsonObject FromTempTable (handle) Returns the JSON Object with the contents of the given Temp-Table
+ CHARACTER GetCharacterByPath (JsonObject, character) Returns the Character Value specified by the given path
+ CHARACTER GetCharacterByPath (JsonObject, character, ArrayBaseEnum) Returns the Character Value specified by the given path
+ INTEGER GetIntegerByPath (JsonObject, character) Returns the Integer Value specified by the given path
+ INTEGER GetIntegerByPath (JsonObject, character, ArrayBaseEnum) Returns the Integer Value specified by the given path
+ Progress.Json.ObjectModel.JsonObject GetJsonObjectByPath (JsonObject, character) Returns the Json Object represented by a path in the source Json Object
+ Progress.Json.ObjectModel.JsonObject GetJsonObjectByPath (JsonObject, character, ArrayBaseEnum) Returns the Json Object represented by a path in the source Json Object
+ LOGICAL GetLogicalByPath (JsonObject, character) Returns the Logical Value specified by the given path
+ LOGICAL GetLogicalByPath (JsonObject, character, ArrayBaseEnum) Returns the Logical Value specified by the given path
+ LOGICAL IsInt64Property (JsonObject, character) Returns if the given property is an Int64 value
+ LOGICAL IsIntegerProperty (JsonObject, character) Returns if the given property is an Integer value
+ CHARACTER JsonArrayToCharacterExtent (JsonArray) Converts a JsonArray into the Character Extent
+ INTEGER JsonArrayToIntegerExtent (JsonArray) Converts a JsonArray into the Integer Extent
+ Consultingwerk.JsonDataTypeEnum JsonDataTypeToEnum (integer) Returns the JsonDataTypeEnum member matching the provided Progress.Json.ObjectModel.JsonDataType integer value
+ Consultingwerk.ListNameValuePair JsonObjectToPropertyList (JsonObject, character) Converts a JsonObject to a property list
- JsonObjectToPropertyList (JsonObject, character, ListNameValuePair, character) Converts a JsonObject to a property list
+ CHARACTER ListFromAttributeValues (JsonObject, character) Returns a delimited list with the values of the given attributes of the JsonObject
+ CHARACTER ListFromAttributeValues (JsonObject, character, character) Returns a delimited list with the values of the given attributes of the JsonObject
+ MergeJsonArrays (JsonArray, JsonArray) Copies the entries of the source JsonArray to the Target JsonArray
+ MergeJsonObjects (JsonObject, JsonObject) Copies the properties of the source JsonObject to the Target JsonObject
+ LOGICAL RemoveEmptyNestedArrays (JsonObject) Removes empty nested JSON Arrays
+ CHARACTER ToCharacter (JsonConstruct) Returns the CHARACTER representation of the given JsonConstruct
+ CHARACTER ToDelimitedList (JsonArray) Returns the values (string, number, boolean, null) of the given JsonArray as a delimited list
+ CHARACTER ToDelimitedList (JsonArray, character) Returns the values (string, number, boolean, null) of the given JsonArray as a delimited list
+ CHARACTER ToDelimitedList (JsonObject, character) Returns an ABL delimited list with the values of the given JsonObject property.
+ CHARACTER ToDelimitedList (JsonObject, character, character) Returns an ABL delimited list with the values of the given JsonObject property.
+ LONGCHAR ToLongchar (JsonObject) Returns the LONGCHAR representation of the given JsonObject

Top Constructor Summary
Options Name Purpose
# JsonHelper () Protected default constructor


Method Detail
Top

PUBLIC Consultingwerk.JsonDataTypeEnum AblDataTypeToJsonDataTypeEnum (character)

Purpose: Returns the JSON Type for the given ABL Data Type
Notes:

Parameters:
pcAblDataType CHARACTER
The ABL Data Type to return the JSON Type for
Returns Consultingwerk.JsonDataTypeEnum
The JsonDataTypeEnum member representing the JSON Data
Top

PUBLIC AddBufferFields (handle, JsonObject, character)

Purpose: Adds the given fields of a buffer to an JSON Object
Notes: Supports array fields, a record must be available

Parameters:
phBuffer HANDLE
The handle of the Buffer
poJsonObject Progress.Json.ObjectModel.JsonObject
The JsonObject to add the fields to
pcFields CHARACTER
Comma delimited list of field names to add or * for all fields. Fields may be qualified with a buffer name or not. When the buffer does not match the current buffer name, the fields are ignored
Top

PUBLIC Progress.Json.ObjectModel.JsonArray AddNewJsonArray (JsonObject, character)

Purpose: Adds a new JsonArray to the given JsonObject
Notes:

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The existing parent JSON Object
pcPropertyName CHARACTER
The name of the property to add the new object to
Returns Progress.Json.ObjectModel.JsonArray
The new JsonArray
Top

PUBLIC Progress.Json.ObjectModel.JsonObject AddNewJsonObject (JsonObject, character)

Purpose: Adds a new JsonObject to the given JsonObject
Notes:

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The existing parent JSON Object
pcPropertyName CHARACTER
The name of the property to add the new object to
Returns Progress.Json.ObjectModel.JsonObject
The new JsonObject
Top

PUBLIC AddObjectPropertiesToJson (Object, JsonObject, character)

Purpose: Adds the properties of the given ABL Object to the
JSON Object
Notes:

Parameters:
poObject Progress.Lang.Object
The ABL object to add properties from
poJson Progress.Json.ObjectModel.JsonObject
The JSON object to add properties to
pcExceptPropertyNames CHARACTER
The property names to exclude from the result
Top

PUBLIC AddObjectPropertiesToJsonArray (Object, JsonArray, character, character, character)

Purpose: Adds the properties of the given ABL Object to the
JSON Array as name/value pairs
Notes:

Parameters:
poObject Progress.Lang.Object
The ABL object to add properties from
poJsonArray Progress.Json.ObjectModel.JsonArray
The JSON object to add properties to
pcExceptPropertyNames CHARACTER
The property names to exclude from the result
pcKey CHARACTER
The name of the json property to hold the ABL property name
pcValue CHARACTER
The name of the json property to hold the ABL property value
Top

PUBLIC AddObjectPropertiesToJsonArray (Object, JsonArray, character, character, character, character)

Purpose: Adds the properties of the given ABL Object to the
JSON Array as name/value pairs
Notes:

Parameters:
poObject Progress.Lang.Object
The ABL object to add properties from
poJsonArray Progress.Json.ObjectModel.JsonArray
The JSON object to add properties to
pcExceptPropertyNames CHARACTER
The property names to exclude from the result
pcKey CHARACTER
The name of the json property to hold the ABL property name
pcValue CHARACTER
The name of the json property to hold the ABL property value
pcPrefix CHARACTER
The property name prefix
Top

PUBLIC AddWidgetPropertiesToJsonArray (handle, JsonArray, character, character, character)

Purpose: Adds the properties of the given widget to the
JSON Array as name/value pairs
Notes:

Parameters:
phWidget HANDLE
The handle of the widget to add properties from
poJsonArray Progress.Json.ObjectModel.JsonArray
The JSON object to add properties to
pcExceptPropertyNames CHARACTER
The property names to exclude from the result
pcKey CHARACTER
The name of the json property to hold the ABL property name
pcValue CHARACTER
The name of the json property to hold the ABL property value
Top

PUBLIC AssignBufferFieldFromJson (handle, JsonObject)

Purpose: Assigns fiels of the buffer from the values of the JSON object
Notes:

Parameters:
phBufferField HANDLE
The handle of the buffer to asign to
poJson Progress.Json.ObjectModel.JsonObject
The JsonObject to assign from
Top

PUBLIC AssignBufferFromJson (handle, JsonObject, character, character)

Purpose: Assigns fiels of the buffer from the values of the JSON object
Notes:

Parameters:
phBuffer HANDLE
The handle of the buffer to asign to
poJson Progress.Json.ObjectModel.JsonObject
The JsonObject to assign from
pcIgnoreProperties CHARACTER
Comma delimited list of JSON properties to ignore
pcIncludeFields CHARACTER
Comma delimited list of fields to include, if set only those fields will be handled, * (or empty) for all fields. Fields may be qualified with a buffer name or not. When the buffer does not match the current buffer name, the fields are ignored
Top

PUBLIC AssignJsonObjectPropertiesFromString (JsonObject, character)

Purpose: Assigns properties in the given JsonObject from a Character value
Notes: The character value must be in the form of the html style attribute, e.g.:
background-color:LightCyan; LightCyan; width:200; xyz: "otto"
Does not support nested objects or arrays
Supports integer and character properties

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The JsonObject to add the properties to
pcProperties CHARACTER
The string containing the properties
Top

PUBLIC CHARACTER AttributeValueList (JsonArray, character)

Purpose: Builds a Character list of the property values in all objects of the array
Notes:

Parameters:
poJsonArray Progress.Json.ObjectModel.JsonArray
The JsonArray
pcPropertyName CHARACTER
The name of the property to build a list of
Returns CHARACTER
The comma delimited list of property values
Top

PUBLIC CHARACTER AttributeValueList (JsonArray, character, character)

Purpose: Builds a Character list of the property values in all objects of the array
Notes:

Parameters:
poJsonArray Progress.Json.ObjectModel.JsonArray
The JsonArray
pcPropertyName CHARACTER
The name of the property to build a list of
pcDelimiter CHARACTER
The list delimiter
Returns CHARACTER
The delimited list of property values
Top

PUBLIC CopyProperties (JsonObject, JsonObject, character)

Purpose: Copies the given JSON Properties from the source JSON to
the targegt JSON
Notes:

Parameters:
poSourceObject Progress.Json.ObjectModel.JsonObject
The source JSON object
poTargetObject Progress.Json.ObjectModel.JsonObject
The target JSON object
pcPropertyNames CHARACTER
The names of the properties to copy
Top

PUBLIC EnsureCharacterProperty (JsonObject, character)

Purpose: Ensures that a primitive JSON property is a character
Notes: Converts boolean and numeric properties to CHARACTER

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The JSON object that contains the character
pcPropertyName CHARACTER
The property to convert to character
Top

PUBLIC CHARACTER ExactPropertyName (JsonObject, character)

Purpose: Returns the property name if found in the JSON object in the exact case
as it appears in the JSON object
Notes: Returns ? when the property is not available

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The JsonObject to search for the property in
pcPropertyName CHARACTER
The property name
Returns CHARACTER
The exact property name as it appears in the JSON object
Top

PUBLIC Progress.Json.ObjectModel.JsonObject FindJsonObjectWithArrayValue (JsonArray, character, integer)

Purpose: Locates the JsonObject from a JsonArray with the requested
integer value in a JsonArray property
Notes:

Parameters:
poJsonArray Progress.Json.ObjectModel.JsonArray
The JsonArray
pcPropertyName CHARACTER
The name of the property
piPropertyValue INTEGER
The value of the property
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject or ? when the property value cannot be found
Top

PUBLIC Progress.Json.ObjectModel.JsonObject FindJsonObjectWithPropertyValue (JsonArray, character, character)

Purpose: Locates the JsonObject from a JsonArray with the requested
character property value
Notes:

Parameters:
poJsonArray Progress.Json.ObjectModel.JsonArray
The JsonArray
pcPropertyName CHARACTER
The name of the property
pcPropertyValue CHARACTER
The value of the property
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject or ? when the property value cannot be found
Top

PUBLIC Progress.Json.ObjectModel.JsonObject FindJsonObjectWithPropertyValue (JsonArray, character, integer)

Purpose: Locates the JsonObject from a JsonArray with the requested
integer property value
Notes:

Parameters:
poJsonArray Progress.Json.ObjectModel.JsonArray
The JsonArray
pcPropertyName CHARACTER
The name of the property
piPropertyValue INTEGER
The value of the property
Returns Progress.Json.ObjectModel.JsonObject
The JsonObject or ? when the property value cannot be found
Top

PUBLIC Progress.Json.ObjectModel.JsonObject FromDataset (handle)

Purpose: Returns the JSON Object with the contents of the given ProDataset
Notes: Workaround, as the Dataset'S WRITE-JSON method does not support
writing to a JsonObject directly

Parameters:
phDataset HANDLE
The handle of the dataset to return as JSON
Returns Progress.Json.ObjectModel.JsonObject
The resulting JsonObject
Top

PUBLIC Progress.Json.ObjectModel.JsonObject FromDataset (handle, logical)

Purpose: Returns the JSON Object with the contents of the given ProDataset
Notes: Workaround, as the Dataset'S WRITE-JSON method does not support
writing to a JsonObject directly

Parameters:
phDataset HANDLE
The handle of the dataset to return as JSON
plIncludeBeforeImage LOGICAL
Logical value indicating if the ProDataset before-tables should should be written as well
Returns Progress.Json.ObjectModel.JsonObject
The resulting JsonObject
Top

PUBLIC Progress.Json.ObjectModel.JsonObject FromTempTable (handle)

Purpose: Returns the JSON Object with the contents of the given Temp-Table
Notes: Workaround, as the Temp-Table'S WRITE-JSON method does not support
writing to a JsonObject directly

Parameters:
phTempTable HANDLE
The handle of the Temp-Table to return as JSON
Returns Progress.Json.ObjectModel.JsonObject
The resulting JsonObject
Top

PUBLIC CHARACTER GetCharacterByPath (JsonObject, character)

Purpose: Returns the Character Value specified by the given path
Notes: Based on GetJsonObjectByPath, the last part of the path specifies
the property name

Parameters:
poSourceJsonObject Progress.Json.ObjectModel.JsonObject
The source Json object that contains the target Json object
pcPath CHARACTER
The path specifying the target object
Returns CHARACTER
The character value or ? when the path is not valid
Top

PUBLIC CHARACTER GetCharacterByPath (JsonObject, character, ArrayBaseEnum)

Purpose: Returns the Character Value specified by the given path
Notes: Based on GetJsonObjectByPath, the last part of the path specifies
the property name

Parameters:
poSourceJsonObject Progress.Json.ObjectModel.JsonObject
The source Json object that contains the target Json object
pcPath CHARACTER
The path specifying the target object
poArrayBase Consultingwerk.ArrayBaseEnum
The array base (one or zero)
Returns CHARACTER
The character value or ? when the path is not valid
Top

PUBLIC INTEGER GetIntegerByPath (JsonObject, character)

Purpose: Returns the Integer Value specified by the given path
Notes: Based on GetJsonObjectByPath, the last part of the path specifies
the property name

Parameters:
poSourceJsonObject Progress.Json.ObjectModel.JsonObject
The source Json object that contains the target Json object
pcPath CHARACTER
The path specifying the target object
Returns INTEGER
The character value or ? when the path is not valid
Top

PUBLIC INTEGER GetIntegerByPath (JsonObject, character, ArrayBaseEnum)

Purpose: Returns the Integer Value specified by the given path
Notes: Based on GetJsonObjectByPath, the last part of the path specifies
the property name

Parameters:
poSourceJsonObject Progress.Json.ObjectModel.JsonObject
The source Json object that contains the target Json object
pcPath CHARACTER
The path specifying the target object
poArrayBase Consultingwerk.ArrayBaseEnum
The array base (one or zero)
Returns INTEGER
The character value or ? when the path is not valid
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetJsonObjectByPath (JsonObject, character)

Purpose: Returns the Json Object represented by a path in the source
Json Object
Notes: The path entries can be delimited by either period (.), slash (/)
or back-slash (\)
Defaults to 1 based arrays (ABL default), Sample path:
dsCustomer.eCustomer[1].eSalesRep[1]

Parameters:
poSourceJsonObject Progress.Json.ObjectModel.JsonObject
The source Json object that contains the target Json object
pcPath CHARACTER
The path specifying the target object
Returns Progress.Json.ObjectModel.JsonObject
The target Json object
Top

PUBLIC Progress.Json.ObjectModel.JsonObject GetJsonObjectByPath (JsonObject, character, ArrayBaseEnum)

Purpose: Returns the Json Object represented by a path in the source
Json Object
Notes: The path entries can be delimited by either period (.), slash (/)
or back-slash (\)
dsCustomer.eCustomer[1].eSalesRep[1]

Parameters:
poSourceJsonObject Progress.Json.ObjectModel.JsonObject
The source Json object that contains the target Json object
pcPath CHARACTER
The path specifying the target object
poArrayBase Consultingwerk.ArrayBaseEnum
The array base (one or zero)
Returns Progress.Json.ObjectModel.JsonObject
The target Json object
Top

PUBLIC LOGICAL GetLogicalByPath (JsonObject, character)

Purpose: Returns the Logical Value specified by the given path
Notes: Based on GetJsonObjectByPath, the last part of the path specifies
the property name

Parameters:
poSourceJsonObject Progress.Json.ObjectModel.JsonObject
The source Json object that contains the target Json object
pcPath CHARACTER
The path specifying the target object
Returns LOGICAL
The character value or ? when the path is not valid
Top

PUBLIC LOGICAL GetLogicalByPath (JsonObject, character, ArrayBaseEnum)

Purpose: Returns the Logical Value specified by the given path
Notes: Based on GetJsonObjectByPath, the last part of the path specifies
the property name

Parameters:
poSourceJsonObject Progress.Json.ObjectModel.JsonObject
The source Json object that contains the target Json object
pcPath CHARACTER
The path specifying the target object
poArrayBase Consultingwerk.ArrayBaseEnum
The array base (one or zero)
Returns LOGICAL
The character value or ? when the path is not valid
Top

PUBLIC LOGICAL IsInt64Property (JsonObject, character)

Purpose: Returns if the given property is an Int64 value
Notes: As JSON does not distinguish between Integer and Decimal
it is required to test values for type compatibility

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The JSON object
pcPropertyName CHARACTER
The property to test for integer
Returns LOGICAL
Logical value indicating if the given property is Integer
Top

PUBLIC LOGICAL IsIntegerProperty (JsonObject, character)

Purpose: Returns if the given property is an Integer value
Notes: As JSON does not distinguish between Integer and Decimal
it is required to test values for type compatibility

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The JSON object
pcPropertyName CHARACTER
The property to test for integer
Returns LOGICAL
Logical value indicating if the given property is Integer
Top

PUBLIC CHARACTER JsonArrayToCharacterExtent (JsonArray)

Purpose: Converts a JsonArray into the Character Extent
Notes: Will error, when the values are not compatible to character

Parameters:
poArray Progress.Json.ObjectModel.JsonArray
The JsonArray to convert
Returns CHARACTER
The Character Extent field
Top

PUBLIC INTEGER JsonArrayToIntegerExtent (JsonArray)

Purpose: Converts a JsonArray into the Integer Extent
Notes: Will error, when the values are not compatible to integer

Parameters:
poArray Progress.Json.ObjectModel.JsonArray
The JsonArray to convert
Returns INTEGER
The Integer Extent field
Top

PUBLIC Consultingwerk.JsonDataTypeEnum JsonDataTypeToEnum (integer)

Purpose: Returns the JsonDataTypeEnum member matching the provided
Progress.Json.ObjectModel.JsonDataType integer value
Notes: OpenEdge is providing an integer constant to qualify JSON data type

Parameters:
piJsonDataType INTEGER
The JsonDataType integer value
Returns Consultingwerk.JsonDataTypeEnum
The matching JsonDataTypoToEnum enum member
Top

PUBLIC Consultingwerk.ListNameValuePair JsonObjectToPropertyList (JsonObject, character)

Purpose: Converts a JsonObject to a property list
Notes: { a: 123, b: { c: 456, d: 789 } } will be turned into
a = 123
b.c = 456
b.d = 789

Parameters:
poJson Progress.Json.ObjectModel.JsonObject
The JsonObject to convert
pcDelimiter CHARACTER
The delimiter to use when processing nested objects
Returns Consultingwerk.ListNameValuePair
The ListNameValuePair with the properties
Top

PRIVATE JsonObjectToPropertyList (JsonObject, character, ListNameValuePair, character)

Purpose: Converts a JsonObject to a property list
Notes: { a: 123, b: { c: 456, d: 789 } } will be turned into
a = 123
b.c = 456
b.d = 789

Parameters:
poJson Progress.Json.ObjectModel.JsonObject
The JsonObject to convert
pcDelimiter CHARACTER
The delimiter to use when processing nested objects
poList Consultingwerk.ListNameValuePair
The list to add properties to
pcPrefix CHARACTER
The prefix to use for the name
Top

PUBLIC CHARACTER ListFromAttributeValues (JsonObject, character)

Purpose: Returns a delimited list with the values of the given
attributes of the JsonObject
Notes:

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The reference to the JsonObject
pcAttributeNames CHARACTER
The comma delimited list with the names of the JSON attributes
Returns CHARACTER
The delimited list with the values
Top

PUBLIC CHARACTER ListFromAttributeValues (JsonObject, character, character)

Purpose: Returns a delimited list with the values of the given
attributes of the JsonObject
Notes:

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The reference to the JsonObject
pcAttributeNames CHARACTER
The comma delimited list with the names of the JSON attributes
pcDelimiter CHARACTER
The list delimited
Returns CHARACTER
The delimited list with the values
Top

PUBLIC MergeJsonArrays (JsonArray, JsonArray)

Purpose: Copies the entries of the source JsonArray to the Target JsonArray
Notes: Treats all numbers as Integer

Parameters:
poSource Progress.Json.ObjectModel.JsonArray
The source JsonArray
poTarget Progress.Json.ObjectModel.JsonArray
The target JsonArray
Top

PUBLIC MergeJsonObjects (JsonObject, JsonObject)

Purpose: Copies the properties of the source JsonObject to the Target JsonObject
Notes: Treats all numbers as Integer

Parameters:
poSource Progress.Json.ObjectModel.JsonObject
The source JsonObject
poTarget Progress.Json.ObjectModel.JsonObject
The target JsonObject
Top

PUBLIC LOGICAL RemoveEmptyNestedArrays (JsonObject)

Purpose: Removes empty nested JSON Arrays
Notes: SCL-1796, removed eSalesrep: [ {} ] from the JSON
Object, recursively processes the JSON data

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The Jsonobject to remove
Returns LOGICAL
Logical value indicating if the JSON has been modified
Top

PUBLIC CHARACTER ToCharacter (JsonConstruct)

Purpose: Returns the CHARACTER representation of the given JsonConstruct
Notes: Truncates the JSON String to 20000 characters

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonConstruct
The JsonConstruct to return the longchar representation of
Returns CHARACTER
The Character representation of the given string
Top

PUBLIC CHARACTER ToDelimitedList (JsonArray)

Purpose: Returns the values (string, number, boolean, null) of the given JsonArray
as a delimited list
Notes:

Parameters:
poJsonArray Progress.Json.ObjectModel.JsonArray
The JsonArray to process
Returns CHARACTER
The delimited list of values
Top

PUBLIC CHARACTER ToDelimitedList (JsonArray, character)

Purpose: Returns the values (string, number, boolean, null) of the given JsonArray
as a delimited list
Notes:

Parameters:
poJsonArray Progress.Json.ObjectModel.JsonArray
The JsonArray to process
pcDelimiter CHARACTER
The list delimiter
Returns CHARACTER
The delimited list of values
Top

PUBLIC CHARACTER ToDelimitedList (JsonObject, character)

Purpose: Returns an ABL delimited list with the values of the given
JsonObject property.
Notes: The value of the property must either be a single string or
an JsonArray of strings or null

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The source JsonObject
pcPropertyName CHARACTER
The name of the property of the JsonObject to return
Returns CHARACTER
The delimited list
Top

PUBLIC CHARACTER ToDelimitedList (JsonObject, character, character)

Purpose: Returns an ABL delimited list with the values of the given
JsonObject property.
Notes: The value of the property must either be a single string or
an JsonArray of strings or null

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The source JsonObject
pcPropertyName CHARACTER
The name of the property of the JsonObject to return
pcDelimiter CHARACTER
The delimiter for the list to return
Returns CHARACTER
The delimited list
Top

PUBLIC LONGCHAR ToLongchar (JsonObject)

Purpose: Returns the LONGCHAR representation of the given JsonObject
Notes:

Parameters:
poJsonObject Progress.Json.ObjectModel.JsonObject
The JsonObject to return the longchar representation of
Returns LONGCHAR
The Longchar representation of the given string


Constructor Detail
Top

PROTECTED JsonHelper ()

Purpose: Protected default constructor
Notes: Disallow instance creation



©2006-2019 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       08.08.2019 23:57:14