Sign in Join
FPDoc Onlineexperiment

TJSONData class

In unit fpJson

Base (abstract) object for all JSON based data types.

Declaration

pascal
TJSONData = class(TObject)

Inheritance

  1. TJSONData
  2. TObject

Descends from it: TJSONArray TJSONBoolean TJSONNull TJSONNumber TJSONObject TJSONString

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 with TJSONBoolean.
null
is supported using TJSONNull
Array
data can be represented using TJSONArray
Object
data can be supported using TJSONObject

See also

Properties

CompressedJSONpublicCompress JSON - skip whitespace.
CountpublicNumber of sub-items for this data element.
ItemspublicIndexed access to sub-items.
ValuepublicThe value of this data object as a variant.
AsStringpublicAccess the raw JSON value as a string.
AsUnicodeStringpublicReturn the value as a Unicode string.
AsInt64publicAccess the raw JSON value as an 64-bit integer.
AsQWordpublicAccess the raw JSON value as an 64-bit unsigned integer.
AsLargeIntpublicAccess to data as largeint.
AsFloatpublicAccess the raw JSON value as a float.
AsIntegerpublicAccess the raw JSON value as an 32-bit integer.
AsBooleanpublicAccess the raw JSON value as a boolean.
IsNullpublicIs the data a null value ?
AsJSONpublicReturn a JSON representation of the value.

Methods

DoErrorprotected
DoFindPathprotected
GetAsBooleanprotected
GetAsFloatprotected
GetAsIntegerprotected
GetIsNullprotected
GetAsInt64protected
GetAsQWordprotected
GetAsUnicodeStringprotected
SetAsInt64protected
SetAsQwordprotected
SetAsUnicodeStringprotected
SetAsBooleanprotected
SetAsFloatprotected
SetAsIntegerprotected
GetAsJSONprotected
GetAsStringprotected
SetAsStringprotected
GetValueprotected
SetValueprotected
GetItemprotected
SetItemprotected
DoFormatJSONprotected
GetCountprotected
JSONTypepublicThe native JSON data type represented by this object.
CreatepublicCreate a new instance of TJSONData.
ClearpublicClear the raw value of this data object.
DumpJSONpublicFast, memory efficient dump of JSON in stream.
GetEnumeratorpublicReturn an enumerator for the data.
FindPathpublicFind data by name.
GetPathpublicGet data by name.
ClonepublicDuplicate the value of the JSON data.
FormatJSONpublicReturn a formatted JSON representation of the data.

Types and constants

TFormatJSONContextprotected

Inherited

From TObject (41)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Destroy Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.