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
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
Indexint
Property Value
Methods
Add(object)
Adds new variant value to the array.
void Add(object Value)
Parameters
Valueobject
AddBoolean(bool)
Adds new boolean value to the array.
void AddBoolean(bool Value)
Parameters
Valuebool
AddDate(DateTime)
Adds new DATE value to the array.
void AddDate(DateTime Value)
Parameters
ValueDateTime
AddDouble(double)
Adds new double value to the array.
void AddDouble(double Value)
Parameters
Valuedouble
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
AddJSONArray(IJSONArray)
Adds new nested array to the array.
void AddJSONArray(IJSONArray Value)
Parameters
ValueIJSONArray
AddJSONObject(IJSONObject)
Adds new nested object to the array.
void AddJSONObject(IJSONObject Value)
Parameters
ValueIJSONObject
AddLong(int)
Adds new long value to the array.
void AddLong(int Value)
Parameters
Valueint
AddNull()
Adds new null value to the array.
void AddNull()
AddString(string)
Adds new string value to the array.
void AddString(string Value)
Parameters
Valuestring
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
ValueIJSONArray
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
ValueIJSONObject
IsValueNull(int)
Checks if an array value at a given index is NULL.
bool IsValueNull(int Index)
Parameters
Indexint
Returns
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
pReaderIJSONReader
ParseString(string)
Parses JSON array from string into memory.
void ParseString(string json)
Parameters
jsonstring
RemoveValue(int)
Remove a value from the member collection.
void RemoveValue(int Index)
Parameters
Indexint
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
objectNamestringpWriterIJSONWriter
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
propsIPropertySet
Returns
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
IndexintValueIJSONArray
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
IndexintValueIJSONObject
Returns
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)