BlogGitHub
Reference/ORK/JSON_NODE/ORK/IF_JSON_NODE_ARRAY
Interface/ORK/IF_JSON_NODE_ARRAY
JSON Array
Package
/ORK/JSON_NODE
Interfaces
/ORK/IF_JSON_NODE, /ORK/IF_JSON_NODE_ENUMERABLE
Members
18
Description

Represents a JSON array node and provides indexed access and mutation. Supports enumeration, cloning, formatting/serialization, equality, and freezing via the base node interface.

Index handling follows ABAP internal table semantics (one-based).

Immutability contract: Any modifying operation must raise an exception if the node is frozen.

18 items
Methods
get
MethodPublic
Get node by index

Returns the node at the given one-based index. If the index is out of range, the optional fallback is returned (if provided).

Parameters

NameDescriptionindexOne-based node indexfallbackFallback node if index is out of range (optional)resultNode at index (or fallback)

Signature

METHODS get IMPORTING !index TYPE i
                        fallback TYPE REF TO /ork/if_json_node OPTIONAL
              RETURNING VALUE(result) TYPE REF TO /ork/if_json_node.
set
MethodPublic
Set node at index

Replaces the node at the given one-based index. Must raise an exception if the node is frozen.

Parameters

NameDescriptionindexOne-based node indexnodeNode to setselfThis array instance (fluent API)

Signature

METHODS set IMPORTING !index TYPE i
                        !node TYPE REF TO /ork/if_json_node
              RETURNING VALUE(self) TYPE REF TO /ork/if_json_node_array.
insert
MethodPublic
Insert node at index

Inserts the provided node at the given one-based index and shifts subsequent nodes. Must raise an exception if the node is frozen.

Parameters

NameDescriptionindexOne-based insertion indexnodeNode to insertselfThis array instance (fluent API)

Signature

METHODS insert IMPORTING !index TYPE i
                           !node TYPE REF TO /ork/if_json_node
                 RETURNING VALUE(self) TYPE REF TO /ork/if_json_node_array.
add
MethodPublic
Append node

Appends the provided node to the end of the array. Must raise an exception if the node is frozen.

Parameters

NameDescriptionnodeNode to appendselfThis array instance (fluent API)

Signature

METHODS add IMPORTING !node TYPE REF TO /ork/if_json_node
              RETURNING VALUE(self) TYPE REF TO /ork/if_json_node_array.
remove
MethodPublic
Remove node by index

Removes the node at the given one-based index. Must raise an exception if the node is frozen.

Parameters

NameDescriptionindexOne-based node indexresultabap_true if a node was removed, otherwise abap_false

Signature

METHODS remove IMPORTING !index TYPE i
                 RETURNING VALUE(result) TYPE abap_bool.
clear
MethodPublic
Clear array

Removes all nodes from the array. Must raise an exception if the node is frozen.

Signature

METHODS clear.
count
MethodPublic
Get node count

Parameters

NameDescriptionresultNumber of nodes in the array

Signature

METHODS count RETURNING VALUE(result) TYPE i.
nodes
MethodPublic
Get nodes table

Returns the internal table of nodes representing the array content. The returned table reflects the current order of the nodes.

Parameters

NameDescriptionresultTable of array nodes

Signature

METHODS nodes RETURNING VALUE(result) TYPE /ork/if_json_node=>ty-nodes.
iterator
MethodPublic
Create iterator

Returns a new iterator instance positioned before the first node.

Parameters

NameDescriptionresultNew iterator instance

Signature

METHODS iterator RETURNING VALUE(result) TYPE REF TO /ork/if_json_node_iterator.
get_array
MethodPublic
Get array node by index

Returns the array node at the given one-based index. If the index is out of range or the node is not an array, the optional fallback is returned.

Parameters

NameDescriptionindexOne-based node indexfallbackFallback array node (optional)resultArray node at index (or fallback)

Signature

METHODS get_array IMPORTING !index TYPE i
                              fallback TYPE REF TO /ork/if_json_node_array DEFAULT /ork/cl_json=>fallback-array
                    RETURNING VALUE(result) TYPE REF TO /ork/if_json_node_array.
get_object
MethodPublic
Get object node by index

Returns the object node at the given one-based index. If the index is out of range or the node is not an object, the optional fallback is returned.

Parameters

NameDescriptionindexOne-based node indexfallbackFallback object node (optional)resultObject node at index (or fallback)

Signature

METHODS get_object IMPORTING !index TYPE i
                               fallback TYPE REF TO /ork/if_json_node_object DEFAULT /ork/cl_json=>fallback-object
                     RETURNING VALUE(result) TYPE REF TO /ork/if_json_node_object.
get_null
MethodPublic
Get null node by index

Returns the null node at the given one-based index. If the index is out of range or the node is not null, the optional fallback is returned.

Parameters

NameDescriptionindexOne-based node indexfallbackFallback null node (optional)resultNull node at index (or fallback)

Signature

METHODS get_null IMPORTING !index TYPE i
                             fallback TYPE REF TO /ork/if_json_node_null DEFAULT /ork/cl_json=>fallback-null
                   RETURNING VALUE(result) TYPE REF TO /ork/if_json_node_null.
get_number
MethodPublic
Get number node by index

Returns the number node at the given one-based index. If the index is out of range or the node is not a number, the optional fallback is returned.

Parameters

NameDescriptionindexOne-based node indexfallbackFallback number node (optional)resultNumber node at index (or fallback)

Signature

METHODS get_number IMPORTING !index TYPE i
                               fallback TYPE REF TO /ork/if_json_node_number DEFAULT /ork/cl_json=>fallback-number
                     RETURNING VALUE(result) TYPE REF TO /ork/if_json_node_number.
get_string
MethodPublic
Get string node by index

Returns the string node at the given one-based index. If the index is out of range or the node is not a string, the optional fallback is returned.

Parameters

NameDescriptionindexOne-based node indexfallbackFallback string node (optional)resultString node at index (or fallback)

Signature

METHODS get_string IMPORTING !index TYPE i
                               fallback TYPE REF TO /ork/if_json_node_string DEFAULT /ork/cl_json=>fallback-string
                     RETURNING VALUE(result) TYPE REF TO /ork/if_json_node_string.
get_bool
MethodPublic
Get boolean node by index

Returns the boolean node at the given one-based index. If the index is out of range or the node is not a boolean, the optional fallback is returned.

Parameters

NameDescriptionindexOne-based node indexfallbackFallback boolean node (optional)resultBoolean node at index (or fallback)

Signature

METHODS get_bool IMPORTING !index TYPE i
                             fallback TYPE REF TO /ork/if_json_node_bool DEFAULT /ork/cl_json=>fallback-bool
                   RETURNING VALUE(result) TYPE REF TO /ork/if_json_node_bool.
get_number_value
MethodPublic
Get number value by index

Returns the numeric value of the number node at the given one-based index. If the index is out of range or the node is not a number, the optional fallback is returned.

Parameters

NameDescriptionindexOne-based node indexfallbackFallback numeric value (optional)resultNumeric value at index (or fallback)

Signature

METHODS get_number_value IMPORTING !index TYPE i
                                     fallback TYPE numeric OPTIONAL
                           RETURNING VALUE(result) TYPE decfloat34.
get_string_value
MethodPublic
Get string value by index

Returns the text value of the string node at the given one-based index. If the index is out of range or the node is not a string, the optional fallback is returned.

Parameters

NameDescriptionindexOne-based node indexfallbackFallback string value (optional)resultString value at index (or fallback)

Signature

METHODS get_string_value IMPORTING !index TYPE i
                                     fallback TYPE string OPTIONAL
                           RETURNING VALUE(result) TYPE string.
get_bool_value
MethodPublic
Get boolean value by index

Returns the boolean value of the boolean node at the given one-based index. If the index is out of range or the node is not a boolean, the optional fallback is returned.

Parameters

NameDescriptionindexOne-based node indexfallbackFallback boolean value (optional)resultBoolean value at index (or fallback)

Signature

METHODS get_bool_value IMPORTING !index TYPE i
                                   fallback TYPE abap_bool OPTIONAL
                         RETURNING VALUE(result) TYPE abap_bool.
Repository11 packages · 113 objects
124 items