Skip to content

TAbstractJSONWriter

Abstract base class for JSON writers

Declaration

Source position: jsonwriter.pp line 37

type

  TAbstractJSONWriter = class(TObject)
  public
    procedure WriteValue(aValue: TStrings);
    procedure WriteValue(aValue: TJSONData);
    procedure WriteValue;
    procedure WriteValue(aValue: Boolean);
    procedure WriteValue(aValue: Integer);
    procedure WriteValue(aValue: Int64);
    procedure WriteValue(aValue: Double);
    procedure WriteValue(const aValue: string);
    procedure WriteProperty(const aName: TJSONStringType);
    procedure WriteProperty(const aName: TJSONStringType; aValue: Boolean);
    procedure WriteProperty(const aName: TJSONStringType; aValue: Integer);
    procedure WriteProperty(const aName: TJSONStringType; aValue: Int64);
    procedure WriteProperty(const aName: TJSONStringType; aValue: Double);
    procedure WriteProperty(const aName: TJSONStringType; 
                       const aValue: string);
    procedure WriteProperty(const aName: TJSONStringType; aValue: TStrings);
    procedure WriteProperty(const aName: TJSONStringType; aValue: TJSONData);
    procedure StartProperty;
    procedure EndProperty;
    procedure StartArray;
    procedure EndArray;
    procedure NextElement;
    procedure StartObject;
    procedure EndObject;
    procedure Flush;
  end;

Description

TAbstractJSONWriter is the abstract base class for all JSON writer implementations. It provides the interface for writing JSON data and implements convenience methods for writing properties. Derived classes must implement the abstract methods for actual writing operations.

Methods

Member Visibility Description
EndArray public End writing a JSON array
EndObject public End writing a JSON object
EndProperty public End writing a property in a JSON object
Flush public Flush any pending output to the destination
NextElement public Prepare for the next element in a JSON array
StartArray public Start writing a JSON array
StartObject public Start writing a JSON object
StartProperty public Start writing a property in a JSON object
WriteProperty public Write a named property to a JSON object
WriteValue public Write a JSON value to the output
See all Methods

See also

Name Description
TJSONDataWriter JSON writer that builds TJSONData tree in memory
TJSONStreamWriter JSON writer that writes directly to a stream