[Overview][Classes][Procedures and functions][Index] | Reference for unit 'JSONPropStorage' (#lcl)

# TCustomJSONPropStorage.Formatted

Controls whether formatted JSON is emitted in the JSONConf storage mechanism.

## Declaration

Source position: jsonpropstorage.pas line 45

`public property TCustomJSONPropStorage.Formatted : Boolean read GetFormatted write SetFormatted;`

## Description

Formatted is a Boolean property which enables or disables formatted output for the JSON written to JSONFileName. When enabled, the JSON objects and elements are written with one named item per line and indenting for nested name/value pairs. For example:

    {
      "TApplication" : {
        "Form1" : {
          "DBGrid1_AlternateColor" : "-2147483643",
          "Form1_Height" : "723",
          "Form1_Left" : "1215",
          "Form1_SessionProperties" : "DBGrid1.AlternateColor;Height;Left;SessionProperties;Top;Width",
          "Form1_Top" : "57",
          "Form1_Width" : "320"
        }
      }
    }

If not enabled, all JSON values are generated on a single line with only whitespace between the JSON name and values.

The property value is assigned to JSONConf when the storage mechanism is allocated for the class instance in StorageNeeded.

## See also

TCustomJSONPropStorage.JSONConf |  | TJSONConfig instance used to store path/value pairs.
TCustomJSONPropStorage.JSONFileName |  | Name of the file where the session property names and values are saved in JSON format.
TCustomJSONPropStorage.StorageNeeded |  | Ensures that the TJSONConfig storage mechanism for the class instance is allocated and configured when needed.
TCustomPropertyStorage.Active |  | Indicates whether the container is Active and allows access to its storage.