Table of Contents

TTMSMCPJSONToClassPropertyType Enumeration

Kind of value a JSON member holds, as inferred from sample data while Delphi class source is generated. It decides the declared type of the generated property.

API unit family: TMS.MCP.Persistence

Remarks

The kind is inferred from the value itself, not from a schema, so it reflects the sample that was supplied: a member that is a whole number in the sample yields an integer property, and the same member with a fractional value yields a floating-point one. An array takes its kind from its first element. The inferred kind can be overridden per property from the export callback, which receives the name and the kind by reference.

Members

Name Description
cptUndefined No kind could be inferred, which is the result for a member that is absent or carries a value that is not recognized. No property is generated for such a member, and asking for its declared type yields the placeholder text UNDEFINED.
cptString Text value, declared as string. It covers a JSON string that is not recognized as a date, a time or a boolean, a numeric string that is kept verbatim rather than converted, and a JSON number that fits none of the numeric kinds.
cptBoolean Two-state value, declared as Boolean. It covers the JSON literals for true and false, and also a JSON string whose text reads as one of them.
cptDateTime Point in time, declared as TDateTime. It covers a JSON string that parses as a date, a time or a combined date and time.
cptObject Nested JSON object, declared as a reference to a class generated for that object. The nested class is named after the property it belongs to.
cptDouble Floating-point number, declared as Double. It covers a JSON number that does not fit either whole-number kind but parses as a fractional value.
cptInteger Whole number that fits 32 bits, declared as Integer. It is the first kind tried for a JSON number.
cptInteger64 Whole number too large for 32 bits, declared as Int64.
cptObjectArray Array of nested objects, declared as an object list of the class generated for the element. It is also the kind an array falls back to when it is empty or when its first element matches none of the other element kinds.
cptStringArray Array whose first element is text, declared as a list of string.
cptBooleanArray Array whose first element is a two-state value, declared as a list of Boolean.
cptDateTimeArray Array whose first element is a point in time, declared as a list of TDateTime.
cptDoubleArray Array whose first element is a floating-point number, declared as a list of Double.
cptIntegerArray Array whose first element is a whole number that fits 32 bits, declared as a list of Integer.
cptInteger64Array Array whose first element is a whole number too large for 32 bits, declared as a list of Int64.