JSON factory: Set the JSONData class types to use.
Source position: fpjson.pp line 784
function SetJSONInstanceType( |
AType: TJSONInstanceType; |
AClass: TJSONDataClass |
AType |
|
Type of data to register a class for. |
AClass |
|
Class to use when a data item of type AType is encountered. |
Previous JSON instance type.
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.
If AClass is not suitable to contain data of type AType, an exception is raised.
|
JSON factory: Get the JSONData class types to use. |
|
|
Create a JSON data item. |