[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
Main class for generating Pascal code from JSON data
Source position: fpjsontopas.pp line 75
type TJSONToPascal = class(TComponent) |
||
public |
||
constructor Create(); override; |
|
Creates a new TJSONToPascal instance |
destructor Destroy; override; |
|
Destroys the TJSONToPascal instance |
procedure Execute; |
|
Generates Pascal code from JSON data |
|
JSON data object to generate code from |
|
property JSONStream: TStream; [rw] |
|
Stream containing JSON data to generate code from |
published |
||
property Active: Boolean; [rw] |
|
Automatically execute code generation when set to True |
property Options: TJSONToPascalOptions; [rw] |
|
Code generation options |
property JSON: TJSONStringType; [rw] |
|
JSON string to generate code from |
|
Generated Pascal unit code |
|
property PropertyMap: TPropertyMap; [rw] |
|
Manual type mappings for JSON properties |
property DestUnitName: string; [rw] |
|
Name of the generated Pascal unit |
property DefaultParentName: string; [rw] |
|
Default base class for generated objects |
property IndentSize: Integer; [rw] |
|
Number of spaces for code indentation |
property ExtraUnitNames: string; [rw] |
|
Additional units for the uses clause |
property PropertyTypeSuffix: string; [rw] |
|
Suffix for generated object and array type names |
property FieldPrefix: string; [rw] |
|
Prefix for private field names |
property ObjectConstructorArguments: string; [rw] |
|
Arguments for object constructors |
property ToplevelObjectClassName: string; [rw] |
|
Name of the main generated class |
end; |
|
Main class for generating Pascal code from JSON data |
|
| | | ||
| | | ||
| | | ||
TJSONToPascal is the core component that generates Object Pascal class definitions from JSON data structures. It analyzes the JSON input and creates complete Pascal unit code with classes that can serialize to and from JSON format.
The class provides comprehensive control over the code generation process through various properties and options. Generated classes include appropriate property declarations, constructor/destructor methods, and optional JSON serialization methods.