[Overview][Constants][Types][Classes][Index] | Reference for unit 'fpjson' (#fcl)

# TJSONData

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

Base (abstract) object for all JSON based data types

## Declaration

Source position: fpjson.pp line 69

`type TJSONData = class(TObject)`
`public`
`constructor Create; virtual;` |  | Create a new instance of TJSONData.
`class function JSONType; virtual;` |  | The native JSON data type represented by this object
`procedure Clear; virtual; abstract;` |  | Clear the raw value of this data object
`function GetEnumerator; virtual;` |  | Return an enumerator for the data
`function FindPath();` |  | Find data by name
`function GetPath();` |  | Get data by name
`function Clone; virtual; abstract;` |  | Duplicate the value of the JSON data
`function FormatJSON();` |  | Return a formatted JSON representation of the data.
`property Count: Integer; [r]` |  | Number of sub-items for this data element
`property Items: TJSONData; [rw]` |  | Indexed access to sub-items
`property Value: variant; [rw]` |  | The value of this data object as a variant.
`property AsString: TJSONStringType; [rw]` |  | Access the raw JSON value as a string
`property AsFloat: TJSONFloat; [rw]` |  | Access the raw JSON value as a float
`property AsInteger: Integer; [rw]` |  | Access the raw JSON value as an 32-bit integer
`property AsInt64: Int64; [rw]` |  | Access the raw JSON value as an 64-bit integer
`property AsBoolean: Boolean; [rw]` |  | Access the raw JSON value as a boolean
`property IsNull: Boolean; [r]` |  | Is the data a null value ?
`property AsJSON: TJSONStringType; [r]` |  | Return a JSON representation of the value
`end;`

## Inheritance

`TJSONData` |  | Base (abstract) object for all JSON based data types
`TObject`

## Description

TJSONData is an abstract class which introduces all properties and methods needed to work with JSON-based data. It should never be instantiated. Based on the type of data that must be represented one of the following descendents must be instantiated instead.

Numbers
  must be represented using one of TJSONIntegerNumber, TJSONFloatNumber or TJSONInt64Number, depending on the type of the number.
Strings
  can be represented with TJSONString.
Boolean
  can be represented withn TJSONBoolean.
null
  is supported using TJSONNull
Array
  data can be represented using TJSONArray
Object
  data can be supported using TJSONObject

## See also

TJSONIntegerNumber |  | Class to represent 32-bit integer JSON data.
TJSONString |  | Class to represent string JSON data.
TJSONBoolean |  | Class to represent boolean JSON data.
TJSONNull |  | Class to represent boolean JSON data.
TJSONArray |  | Class of TJSONArray
TJSONObject |  | Class of TJSONObject

Documentation generated on: Feb 26 2014