Interface IJSONArray

Namespace
ESRI.ArcGIS.esriSystem
Assembly
ESRI.Server.System.dll

Provides simplified DOM-like JSON serialization and de-serialization API.

[Guid("4ABE3BC0-6D3C-4FBA-9C55-C9AC7C32D9B1")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IJSONArray

Properties

Count

Returns an array size.

int Count { get; }

Property Value

int

Value[int]

Returns an array value at a given index. Returns E_INVALIDARG if index is out of bounds.

object Value[int Index] { get; }

Parameters

Index int

Property Value

object

Methods

Add(object)

Adds new variant value to the array.

void Add(object Value)

Parameters

Value object

AddBoolean(bool)

Adds new boolean value to the array.

void AddBoolean(bool Value)

Parameters

Value bool

AddDate(DateTime)

Adds new DATE value to the array.

void AddDate(DateTime Value)

Parameters

Value DateTime

AddDouble(double)

Adds new double value to the array.

void AddDouble(double Value)

Parameters

Value double

AddDoubleEx(double, int)

Adds new double value to the array. Stores precision for use in ToJSON and ToJSONString

void AddDoubleEx(double Value, int precision)

Parameters

Value double
precision int

AddJSONArray(IJSONArray)

Adds new nested array to the array.

void AddJSONArray(IJSONArray Value)

Parameters

Value IJSONArray

AddJSONObject(IJSONObject)

Adds new nested object to the array.

void AddJSONObject(IJSONObject Value)

Parameters

Value IJSONObject

AddLong(int)

Adds new long value to the array.

void AddLong(int Value)

Parameters

Value int

AddNull()

Adds new null value to the array.

void AddNull()

AddString(string)

Adds new string value to the array.

void AddString(string Value)

Parameters

Value string

ClearAll()

Removes all values.

void ClearAll()

CreateMemberArray(out IJSONArray)

Creates and adds new member to the member collection. Returns E_FAIL if creation of the member fails.

void CreateMemberArray(out IJSONArray Value)

Parameters

Value IJSONArray

CreateMemberObject(out IJSONObject)

Creates and adds new member to the member collection. Returns E_FAIL if creation of the member fails.

void CreateMemberObject(out IJSONObject Value)

Parameters

Value IJSONObject

IsValueNull(int)

Checks if an array value at a given index is NULL.

bool IsValueNull(int Index)

Parameters

Index int

Returns

bool

ParseJSON(IJSONReader)

Parses JSON array from IJSONReader into memory. Useful if you want to have random acces to just a part of a JSON.

void ParseJSON(IJSONReader pReader)

Parameters

pReader IJSONReader

ParseString(string)

Parses JSON array from string into memory.

void ParseString(string json)

Parameters

json string

RemoveValue(int)

Remove a value from the member collection.

void RemoveValue(int Index)

Parameters

Index int

ToJSON(string, IJSONWriter)

Converts IJSONArray to JSON representation using provided IJSONWriter. Useful when you have complex JSON response you want to combine from the output of several methods.

void ToJSON(string objectName, IJSONWriter pWriter)

Parameters

objectName string
pWriter IJSONWriter

ToJSONString(IPropertySet)

Converts IJSONArray to JSON representation using IJSONWriter internally. 'props' parameter is to control IJSONWriter properties. It's safe to set it to NULL.

string ToJSONString(IPropertySet props)

Parameters

props IPropertySet

Returns

string

TryGetValueAsArray(int, out IJSONArray)

Returns array value at a given index as IJSONArray. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

bool TryGetValueAsArray(int Index, out IJSONArray Value)

Parameters

Index int
Value IJSONArray

Returns

bool

TryGetValueAsBoolean(int, out bool)

Returns array value at a given index as boolean. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

bool TryGetValueAsBoolean(int Index, out bool Value)

Parameters

Index int
Value bool

Returns

bool

TryGetValueAsDate(int, out DateTime)

Returns array value at a given index as DATE. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

bool TryGetValueAsDate(int Index, out DateTime Value)

Parameters

Index int
Value DateTime

Returns

bool

TryGetValueAsDouble(int, out double)

Returns array value at a given index as double. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

bool TryGetValueAsDouble(int Index, out double Value)

Parameters

Index int
Value double

Returns

bool

TryGetValueAsLong(int, out int)

Returns array value at a given index as long. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

bool TryGetValueAsLong(int Index, out int Value)

Parameters

Index int
Value int

Returns

bool

TryGetValueAsObject(int, out IJSONObject)

Returns array value at a given index as IJSONObject. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

bool TryGetValueAsObject(int Index, out IJSONObject Value)

Parameters

Index int
Value IJSONObject

Returns

bool

TryGetValueAsString(int, out string)

Returns array value at a given index as string. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

bool TryGetValueAsString(int Index, out string Value)

Parameters

Index int
Value string

Returns

bool