SetJSONInstanceType function
JSON factory: Set the JSONData class types to use.
Declaration
function SetJSONInstanceType(AType: TJSONInstanceType;
AClass: TJSONDataClass): TJSONDataClassArguments
AType | Type of data to register a class for. |
AClass | Class to use when a data item of type
|
Function result
Previous JSON instance type.
Description
SetJSONInstanceType can be used to register descendents of the
TJSONData class, one for each possible kind of data. The class
type used to instantiate data of type
AType is passed in
AClass.
The JSON parser will use the registered types to instantiate JSON Data
instanced: when the parser encounters a value of type AType,
it will instantiate a class of type AClass.
By default, the classes in the fpJSON unit are used.
The CreateJSON functions also use the types registered here to instantiate their data.
The return value is the previously registered instance type for the
AType.
Errors
If
AClass is not suitable to contain data of type
AType, an exception is raised.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
