Class TXQValueObject

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TXQValueObject = class(TXQValueJSONIQItem)

Description

(Experimental) object type. Every object obj has properties obj.something which are arbitrary TXQValue-s and a prototype from which it inherits all properties.
The objects can be used mutable and immutable. If used immutable, they still appear mutable, but every change creates a new object that is linked to the previous objects (i.e. has the old object as prototype).
(Having the objects immutable, is necessary for the template matcher, so that it can correctly rollback all changes)

Hierarchy

Overview

Fields

Public values: TXQVariableChangeLog;
Public prototype: IXQValue;

Methods

Public constructor create(); reintroduce; virtual;
Public constructor createTakingVariableLog(log: TXQVariableChangeLog);
Public destructor Destroy; override;
Public class function classKind: TXQValueKind; override;
Public function hasProperty(const name: string; value: PXQValue): boolean;
Public function getProperty(const name: string): IXQValue; override;
Public function getPropertyEnumerator: TXQValuePropertyEnumerator; override;
Public procedure setMutable(const name: string; const v: IXQValue);
Public function setImmutable(const name: string; const v: IXQValue): TXQValueObject;
Public procedure setMutable(const name: string; const s: string);
Public function setImmutable(const name: string; const s: string): TXQValueObject;
Public function setImmutable(const properties: TStringArray; const v: IXQValue; startIndex: integer = 0): TXQValueObject;
Public procedure enumerateKeys(sl: TStringList);
Public function enumerateValues: IXQValue;
Public function toBooleanEffective: boolean; override;
Public function clone: IXQValue; override;
Public function cloneLinked: TXQValueObject;
Public function jsonSerialize(nodeFormat: TTreeNodeSerialization; insertWhitespace: boolean = false; const indent: string = ''): string; override;
Public function xmlSerialize(nodeFormat: TTreeNodeSerialization; sequenceTag: string = 'seq'; elementTag: string = 'e'; objectTag: string = 'object'): string; override;
Public class procedure prepareInternetRequest(const obj: IXQValue; out method, url, post: string; internet: TInternetAccess); static;

Description

Fields

Public values: TXQVariableChangeLog;
 
Public prototype: IXQValue;
 

Methods

Public constructor create(); reintroduce; virtual;
 
Public constructor createTakingVariableLog(log: TXQVariableChangeLog);
 
Public destructor Destroy; override;
 
Public class function classKind: TXQValueKind; override;
 
Public function hasProperty(const name: string; value: PXQValue): boolean;

Checks if the object (or its prototype) has a certain property, and returns the property value directly (i.e. changing valueˆ will change the value stored in the object).
(You can pass nil for value, if you don't need the value)

Public function getProperty(const name: string): IXQValue; override;

Returns the value of a property

Public function getPropertyEnumerator: TXQValuePropertyEnumerator; override;
 
Public procedure setMutable(const name: string; const v: IXQValue);

Changes a property

Public function setImmutable(const name: string; const v: IXQValue): TXQValueObject;

Creates a new object with the same values as the current one and changes a property of it

Public procedure setMutable(const name: string; const s: string);

Changes a property (string wrapper)

Public function setImmutable(const name: string; const s: string): TXQValueObject;

Creates a new object with the same values as the current one and changes a property of it (string wrapper)

Public function setImmutable(const properties: TStringArray; const v: IXQValue; startIndex: integer = 0): TXQValueObject;
 
Public procedure enumerateKeys(sl: TStringList);
 
Public function enumerateValues: IXQValue;
 
Public function toBooleanEffective: boolean; override;
 
Public function clone: IXQValue; override;

Creates a hard clone of the object (i.e. also clones all properties)

Public function cloneLinked: TXQValueObject;

Creates a weak clone (linked to the current object)

Public function jsonSerialize(nodeFormat: TTreeNodeSerialization; insertWhitespace: boolean = false; const indent: string = ''): string; override;
 
Public function xmlSerialize(nodeFormat: TTreeNodeSerialization; sequenceTag: string = 'seq'; elementTag: string = 'e'; objectTag: string = 'object'): string; override;
 
Public class procedure prepareInternetRequest(const obj: IXQValue; out method, url, post: string; internet: TInternetAccess); static;
 

Generated by PasDoc 0.14.0.