System.JSON.Builders.TJSONCollectionBuilder.TParentCollection

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

TParentCollection = class;

C++

class PASCALIMPLEMENTATION TParentCollection : public TJSONCollectionBuilder::TBaseCollection

Properties

Type Visibility Source Unit Parent
class public
System.JSON.Builders.pas
System.JSON.Builders.hpp
System.JSON.Builders TJSONCollectionBuilder

Description

JSON builder that allows you either to add key-value pairs to a JSON object or to add values to a JSON array.

Do not create an instance of TParentCollection manually. Methods that put an end to a JSON array or a JSON object, such as TPairs.EndObject or TElements.EndArray, return an instance of TParentCollection that represents the parent structure of the closed array or object, if any.

Once you have an instance of TParentCollection, the methods that you can use depending on whether your instance of TParentCollection represents an object or an array.
If it represents an object, you can use the same methods as TPairs.
If it represents an array, you can use the same methods as TElements.
If you use an invalid method, TParentCollection raises an exception.

The methods in the list below provide several signatures. The signatures of each method that you can use depend on whether your instance of TParentCollection represents an object or an array. You can use these methods to add key-value pairs to your object or values to your array:

After you fill your object or array, call EndObject or EndArray to go back to the parent structure of the object or array (if any).

Use AsObject or AsArray to convert your instance of TParentCollection into an instance of TPairs or TElements, respectively.