pdk.flow.JsonArray
functions to operate with JSON array
All functions
addBoolean
adds new element with type Boolean to the input array.
Arguments:
jsonArray :: pdk.net.JsonArray
value :: pdk.core.Boolean
Result:
No variable is returned. An array contains a new element.
Possible exceptions
NullPointerException - throws if the input jsonArray is
NULL
Example:
jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.Boolean = true
addBoolean(jsonArray, value) :: Void ->
jsonArray = [true]
value = true
addFloat
adds new element with type Float to the input array.
Arguments:
jsonArray :: pdk.net.JsonArray
value :: pdk.core.Float
Result:
No variable is returned. An array contains a new element.
Possible exceptions
NullPointerException - throws if the input jsonArray is
NULL
Example:
jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.Float = 3.1415
addFloat(jsonArray, value) :: Void ->
jsonArray = [3.1415]
value = 3.1415
addInteger
adds new element with type Integer to the input array.
Arguments:
jsonArray :: pdk.net.JsonArray
value :: pdk.core.Integer
Result:
No variable is returned. An array contains a new element.
Possible exceptions
NullPointerException - throws if the input jsonArray is
NULL
Example:
jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.Integer = 100
addInteger(jsonArray, value) :: Void ->
jsonArray = [100]
value = 100
addString
adds new element with type String to the input array.
Arguments:
jsonArray :: pdk.net.JsonArray
value :: pdk.core.String
Result:
No variable is returned. An array contains a new element.
Possible exceptions
NullPointerException - throws if the input jsonArray is
NULL
Example:
jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.String = 'Amsterdam'
addString(jsonArray, value) :: Void ->
jsonArray = ['Amsterdam']
value = 'Amsterdam'
addJsonObject
adds new element with type JsonObject to the input array.
Arguments:
jsonArray :: pdk.net.JsonArray
value :: pdk.net.JsonObject
Result:
No variable is returned. An array contains a new element.
Possible exceptions
NullPointerException - throws if the input jsonArray is
NULL
Example:
jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.JsonObject = {
address: 'Korte Ouderkerkerdijk'
}
addJsonObject(jsonArray, value) :: Void ->
jsonArray = [{
address: 'Korte Ouderkerkerdijk'
}]
value = {
address: 'Korte Ouderkerkerdijk'
}
addJsonArray
adds new element with type JsonArray to the input array.
Arguments:
jsonArray :: pdk.net.JsonArray
value :: pdk.net.JsonArray
Result:
No variable is returned. An array contains a new element.
Possible exceptions
NullPointerException - throws if the input jsonArray is
NULL
Example:
jsonArray :: pdk.net.JsonArray = []
value :: pdk.core.JsonArray = [{
address: 'Korte Ouderkerkerdijk'
}]
addJsonArray(jsonArray, value) :: Void ->
jsonArray = [[{
address: 'Korte Ouderkerkerdijk'
}]]
value = [{
address: 'Korte Ouderkerkerdijk'
}]
setBoolean
replaces the existing element with a new element of type Boolean.
Arguments:
jsonArray :: pdk.net.JsonArray
position :: pdk.core.Integer
value :: pdk.core.Boolean
Result:
No variable is returned. An array contains a new element.
Possible exceptions
IndexOutOfBoundsException - throws if the index is greater than the length of the jsonArray
NullPointerException - throws if the input array or the position is
NULL
Example:
jsonArray :: pdk.net.JsonArray = [1, 'Amsterdam', 3.1415]
position :: pdk.core.Integer = 1
value :: pdk.core.Boolean = true
setBoolean(jsonArray, position, value) :: Void ->
jsonArray = [1, true, 3.1415]
value = true
setFloat
replaces the existing element with a new element of type Float.
Arguments:
jsonArray :: pdk.net.JsonArray
position :: pdk.core.Integer
value :: pdk.core.Float
Result:
No variable is returned. An array contains a new element.
Possible exceptions
IndexOutOfBoundsException - throws if the index is greater than the length of the jsonArray
NullPointerException - throws if the input array or the position is
NULL
Example:
jsonArray :: pdk.net.JsonArray = [1, 'Amsterdam', false]
position :: pdk.core.Integer = 1
value :: pdk.core.Float = 3.1415
setFloat(jsonArray, position, value) :: Void ->
jsonArray = [1, 3.1415, false]
value = 3.1415
setInteger
replaces the existing element with a new element of type Integer.
Arguments:
jsonArray :: pdk.net.JsonArray
position :: pdk.core.Integer
value :: pdk.core.Integer
Result:
No variable is returned. An array contains a new element.
Possible exceptions
IndexOutOfBoundsException - throws if the index is greater than the length of the jsonArray
NullPointerException - throws if the input array or the position is
NULL
Example:
jsonArray :: pdk.net.JsonArray = [3.1415, 'Amsterdam', false]
position :: pdk.core.Integer = 1
value :: pdk.core.Integer = 100
setInteger(jsonArray, position, value) :: Void ->
jsonArray = [3.1415, 100, false]
value = 100
setString
replaces the existing element with a new element of type String.
Arguments:
jsonArray :: pdk.net.JsonArray
position :: pdk.core.Integer
value :: pdk.core.String
Result:
No variable is returned. An array contains a new element.
Possible exceptions
IndexOutOfBoundsException - throws if the index is greater than the length of the jsonArray
NullPointerException - throws if the input array or the position is
NULL
Example:
jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]
position :: pdk.core.Integer = 1
value :: pdk.core.String = 'Amsterdam'
setString(jsonArray, position, value) :: Void ->
jsonArray = [3.1415, 'Amsterdam', false]
value = 'Amsterdam'
setJsonObject
replaces the existing element with a new element of type JsonObject.
Arguments:
jsonArray :: pdk.net.JsonArray
position :: pdk.core.Integer
value :: pdk.net.JsonObject
Result:
No variable is returned. An array contains a new element.
Possible exceptions
IndexOutOfBoundsException - throws if the index is greater than the length of the jsonArray
NullPointerException - throws if the input array or the position is
NULL
Example:
jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]
position :: pdk.core.Integer = 1
value :: pdk.core.JsonObject = {
address: 'Korte Ouderkerkerdijk'
}
setJsonObject(jsonArray, position, value) :: Void ->
jsonArray = [3.1415, {
address: 'Korte Ouderkerkerdijk'
}, false]
value = {
address: 'Korte Ouderkerkerdijk'
}
setJsonArray
replaces the existing element with a new element of type JsonArray.
Arguments:
jsonArray :: pdk.net.JsonArray
position :: pdk.core.Integer
value :: pdk.net.JsonArray
Result:
No variable is returned. An array contains a new element.
Possible exceptions
IndexOutOfBoundsException - throws if the index is greater than the length of the jsonArray
NullPointerException - throws if the input array or the position is
NULL
Example:
jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]
position :: pdk.core.Integer = 1
value :: pdk.core.JsonArray = [{
address: 'Korte Ouderkerkerdijk'
}]
setJsonArray(jsonArray, position, value) :: Void ->
jsonArray = [3.1415, [{
address: 'Korte Ouderkerkerdijk'
}], false]
value = [{
address: 'Korte Ouderkerkerdijk'
}]
removeItem
removes the element at a specific position from the jsonArray.
Arguments:
jsonArray :: pdk.net.JsonArray
position :: pdk.core.Integer
Result:
No variable is returned. An array without an element removed from the specified position.
Possible exceptions
IndexOutOfBoundsException - throws if the position is greater than the length of the jsonArray
NullPointerException - throws if the input array or the position is
NULL
Example:
jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]
position :: pdk.core.Integer = 1
removeItem(jsonArray, position) :: Void ->
jsonArray = [3.1415, false]
removeAll
removes all elements from the jsonArray.
Arguments:
jsonArray :: pdk.net.JsonArray
Result:
No variable is returned. An array is empty.
Possible exceptions
NullPointerException - throws if the input array is
NULL
Example:
jsonArray :: pdk.net.JsonArray = [3.1415, 100, false]
removeAll(jsonArray) :: Void ->
jsonArray = []
mappingToVariable
assigns the JSON Array data to a variable.
Arguments:
jsonArray :: pdk.net.JsonArray
variable :: pdk.core.Array<UserObject>
Result:
No output. The variable is initialized.
Possible exceptions
NullPointerException - throws if the input jsonArray is
NULL
JsonMapException - throws if the jsonArray item structure can not be mapped to the variable array item structure
Last updated