Table of Contents

TTMSMCPJSONToClassOptions Record

Defines options used when generating Delphi classes from JSON data.

API unit family: TMS.MCP.Persistence

Syntax

TTMSMCPJSONToClassOptions = record

Fields and properties

Name Type Description
AddAssign Boolean When True, an Assign method that copies every generated property is declared on each class. Its signature follows the selected base class: an overridden TPersistent method, or a plain method taking a TObject when no base class is used.
AddConstructor Boolean When True, a parameterless constructor is declared on each generated class, and implemented when the implementation section is generated as well.
AddDestructor Boolean When True, an overridden destructor is declared on each generated class, and implemented when the implementation section is generated as well.
AddImplementation Boolean When True, the implementation section with the bodies of the generated constructor, destructor and Assign method is emitted as well. It is only written when a complete unit is generated.
AddUnit Boolean When True, the generated classes are wrapped in a complete unit with its own interface section, instead of being emitted as bare type declarations.
BaseClass TTMSMCPJSONToClassBaseClass Base class the generated classes derive from, which also decides the signature of the generated Assign method.
DelphiCasing Boolean When True, each underscore-separated part of a JSON key is capitalized, so first_name becomes FirstName. When False the key is used as it is.
RemoveSpecialCharacters Boolean When True, every character in a JSON key that is neither a letter nor a digit is replaced by an underscore, so that keys containing spaces or punctuation still yield valid identifiers.
SortProperties Boolean When True, the properties of each generated class are sorted by name instead of keeping the order they appear in the JSON data.