This document is archived and information here might be outdated.  Recommended version.


IJSONObject2 Interface (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (System)  

IJSONObject2 Interface

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

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Method Add Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method AddBoolean Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method AddDate Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method AddDouble Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method AddDoubleEx Adds new member name-value pair to the member collection. Stores precision for use in ToJSON and ToJSONString. Returns E_FAIL if duplicate member is found.
Method AddInt64 Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method AddJSONArray Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method AddJSONObject Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method AddLong Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method AddNull Adds new member with the value of null to the member collection. Returns E_FAIL if duplicate member is found.
Method AddString Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method AddUInt64 Adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Read/write property CaseSensitiveNames Returns true if member name lookups are case-sensitive. Default value is true. Methods affected by this state change: MemberExists, IsValueNull and all TryGet... methods.
Method ClearAll Removes all members.
Method CreateMemberArray Creates and adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method CreateMemberObject Creates and adds new member name-value pair to the member collection. Returns E_FAIL if duplicate member is found.
Method GetMemberAt Returns member name and value at a given index.
Method IsValueNull Returns VARIANT_TRUE if member is undefined or member's value is null. Returns VARIANT_FALSE if member exists and its value is not null.
Method MakeValueNull Make a designated member NULL.
Read-only property MemberCount Returns size of member collection.
Method MemberExists Checks if a member with the given name exists.
Method ParseJSON Parses JSON object from IJSONReader into memory. Useful if you want to have random access to just a part of a JSON.
Method ParseString Parses JSON object from string into memory.
Method RemoveMember Remove a member from the member collection.
Method ToJSON Converts IJSONObject to JSON representation using provided IJSONWriter. Useful when you have complex JSON response you want to combine from the output of several methods.
Method ToJSONString Converts IJSONObject to JSON representation using IJSONWriter internally. 'props' parameter is to control IJSONWriter properties. It's safe to set it to NULL.
Method TryGetValue Returns member value for a given name. If member does not exist, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsArray Returns member value for a given name as IJSONArray. If member does not exist or type coercion fails, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsBoolean Returns member value for a given name as boolean. If member does not exist or type coercion fails, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsDate Returns member value for a given name as DATE. If member does not exist or type coercion fails, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsDouble Returns member value for a given name as double. If member does not exist or type coercion fails, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsInt64 Returns member value for a given name as LONGLONG. If member does not exist or type coercion fails, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsLong Returns member value for a given name as long. If member does not exist or type coercion fails, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsObject Returns member value for a given name as IJSONObject. If member does not exist or type coercion fails, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsString Returns member value for a given name as string. If member does not exist or type coercion fails, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsUInt64 Returns member value for a given name as ULONGLONG. If member does not exist or type coercion fails, returns VARIANT_FALSE in 'success' parameter.
Method TryGetValueAsVariant Returns member valuefor a given name as a VARIANT of the requested type. If member does not exist, returns VARIANT_FALSE in 'success' parameter.

Inherited Interfaces

Interfaces Description
IJSONObject Provides simplified DOM-like JSON serialization and de-serialization API.

CoClasses that implement IJSONObject2

CoClasses and Classes Description
JSONObject Simplified JSON API coclass