Unit 'fpJsonToPas' Package
[Overview][Types][Classes][Index] [#fcl]

TJSONToPascal

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Main class for generating Pascal code from JSON data

Declaration

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

  property JSONData: TJSONData; [rw]

  

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

  property Code: TStrings; [rw]

  

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;

Inheritance

TJSONToPascal

  

Main class for generating Pascal code from JSON data

|

TComponent

|

TPersistent,IUnknown,IInterfaceComponentReference

|

TObject,IFPObserved

Description

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.


Documentation generated on: Jan 27 2026