A representation of a JSON Member object. This is created automatically when a member is added to the JSON object or the JSON object is parsed with members that already exist.

 

Properties

Property

Default

Description

baseClassName

JSONMEMBER

Identifies the object as an instance of the JSONMEMBER class

className

(JSONMEMBER)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

member

null

Object reference to a dBASE JSONMember object used to access the current member within a JSON sub-object, if a nested JSON object was contained in the parsed JSON text.

name

 

key name assigned to the current JSON object member

parent

 

Object reference to the immediate parent object for the current member object

value

 

value assigned to the current JSON object member

Method

Parameters

Description

isArray()

 

returns True if the last parsed JSON text contained  a JSON array

isEmpty()

 

returns True if the dBASE JSON() instance does not contain any JSON data

isObject()

 

returns True if the last parsed JSON text contained a JSON member object

 

 

Methods to use when isObject() returns True

 

Method

Parameters

Description

addMember()

<key string>, <value>

adds new member <key string> with value <value> to object

findMember()

<Key string>

searches for <key string>.

returns True if found,

otherwise, returns False.

If found, sets member property to reference the found member

firstKey()

 

returns key string for first member of JSON object

firstMember()

 

sets member property to first member of object

hasMember()

<key string>

returns True if <key string> is found within the top level members of the object tree, otherwise, returns False.

lastMember()

 

sets member property to last member of object

memberCount()

 

returns the number of top level members within a JSON object, otherwise returns zero

nextKey()

 

returns key string for next key string after specified <key string>

nextMember()

 

sets member property to next member of object after the member currently referenced

previousMember()

 

sets member property to previous member of object before the member currently referenced

removeAllMembers()

 

removes all members from JSON object

removeMember()

<key string>

removes member <key string> from JSON object

setMemberValue()

<Key string>,<value>

changes <value> assigned to member <key string>

 

 

Methods to use when isArray() returns True

 

Method

Parameters

Description

append()

 <value>

adds new element to JSON Array and assigns <value> to it

capacity()

 

returns number of elements that can fit in the memory currently allocated for a JSON Array

clear()

 

 deletes all elements of JSON Array

delete()

nIndex

deletes array element <nindex> from JSON Array

getAt()

<nIndex>

returns value of array element specified by <nindex> (<nindex> is 1 based).

reserve()

<capacity>

allocates enough memory to hold <capacity> elements in a JSON Array

setAt()

<index>,<value>

returns True if able to assign <value> to array element <index>, otherwise, returns False.

size()

 

returns number of elements currently in the array