com.esri.arcgis.system
Class JSONArray

java.lang.Object
  extended by com.esri.arcgis.system.JSONArray
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IJSONArray, IJSONArray2, ISupportErrorInfo, java.io.Serializable

public class JSONArray
extends java.lang.Object
implements com.esri.arcgis.interop.RemoteObjRef, IJSONArray, IJSONArray2, ISupportErrorInfo

COM Class 'JSONArray'. Generated 3/19/2015 1:20:47 PM from 'C:\ArcGIS\COM\esriSystem.olb'

Description 'Simplified JSON API coclass' Generator Options: PromptForTypeLibraries = False ClashPrefix = esri_ LowerCaseMemberNames = True IDispatchOnly = False RetryOnReject = False AwtForOcxs = True ArraysAsObjects = False DontRenameSameMethods = False ImplementConflictingInterfaces = True ReuseMethods = True RenameConflictingInterfaceMethods = True GenBeanInfo = True GenerateJavadoc =

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.system.IJSONArray2
IID, IID71208a81_c9e0_48c9_a81a_18558cb6ea2e, xxDummy
 
Fields inherited from interface com.esri.arcgis.system.IJSONArray
IID4abe3bc0_6d3c_4fba_9c55_c9ac7c32d9b1
 
Fields inherited from interface com.esri.arcgis.system.ISupportErrorInfo
IID, IIDdf0b3d60_548f_101b_8e65_08002b2bd119, xxDummy
 
Constructor Summary
JSONArray()
          Constructs a JSONArray using ArcGIS Engine.
JSONArray(java.lang.Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
JSONArray theJSONArray = (JSONArray) obj;
 
Method Summary
 void add(java.lang.Object value)
          Adds new variant value to the array.
 void addBoolean(boolean value)
          Adds new boolean value to the array.
 void addDate(java.util.Date value)
          Adds new DATE value to the array.
 void addDouble(double value)
          Adds new double value to the array.
 void addDoubleEx(double value, int precision)
          Adds new double value to the array.
 void addInt64(long value)
          Adds new variant value to the array.
 void addJSONArray(IJSONArray value)
          Adds new nested array to the array.
 void addJSONObject(IJSONObject value)
          Adds new nested object to the array.
 void addLong(int value)
          Adds new long value to the array.
 void addNull()
          Adds new null value to the array.
 void addString(java.lang.String value)
          Adds new string value to the array.
 void addUInt64(long value)
          Adds new variant value to the array.
 void clearAll()
          Removes all values.
 void createMemberArray(IJSONArray[] value)
          Creates and adds new member to the member collection.
 void createMemberObject(IJSONObject[] value)
          Creates and adds new member to the member collection.
 boolean equals(java.lang.Object o)
          Compare this object with another
static java.lang.String getClsid()
          getClsid.
 int getCount()
          Returns an array size.
 com.esri.arcgis.interop.Dispatch getJintegraDispatch()
          Deprecated. Internal use only.
 java.lang.Object getValue(int index)
          Returns an array value at a given index.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 boolean isValueNull(int index)
          Checks if an array value at a given index is NULL.
 void parseJSON(IJSONReader pReader)
          Parses JSON array from IJSONReader into memory.
 void parseString(java.lang.String json)
          Parses JSON array from string into memory.
 void release()
          Release a JSONArray.
 void removeValue(int index)
          Remove a value from the member collection.
 void toJSON(java.lang.String objectName, IJSONWriter pWriter)
          Converts IJSONArray to JSON representation using provided IJSONWriter.
 java.lang.String toJSONString(IPropertySet props)
          Converts IJSONArray to JSON representation using IJSONWriter internally.
 boolean tryGetValueAsArray(int index, IJSONArray[] value)
          Returns array value at a given index as IJSONArray.
 boolean tryGetValueAsBoolean(int index, boolean[] value)
          Returns array value at a given index as boolean.
 boolean tryGetValueAsDate(int index, java.util.Date[] value)
          Returns array value at a given index as DATE.
 boolean tryGetValueAsDouble(int index, double[] value)
          Returns array value at a given index as double.
 boolean tryGetValueAsInt64(int index, long[] value)
          Returns array value at a given index as LONGLONG.
 boolean tryGetValueAsLong(int index, int[] value)
          Returns array value at a given index as long.
 boolean tryGetValueAsObject(int index, IJSONObject[] value)
          Returns array value at a given index as IJSONObject.
 boolean tryGetValueAsString(int index, java.lang.String[] value)
          Returns array value at a given index as string.
 boolean tryGetValueAsUInt64(int index, long[] value)
          Returns array value at a given index as ULONGLONG.
 boolean tryGetValueAsVariant(int index, int variantType, java.lang.Object[] value)
          Returns array value at a given index as a VARIANT of the requested type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONArray

public JSONArray()
          throws java.io.IOException,
                 java.net.UnknownHostException
Constructs a JSONArray using ArcGIS Engine.

Throws:
java.io.IOException - if there are interop problems
java.net.UnknownHostException - if there are interop problems

JSONArray

public JSONArray(java.lang.Object obj)
          throws java.io.IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
JSONArray theJSONArray = (JSONArray) obj;

Construct a JSONArray using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to JSONArray.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
java.io.IOException - if there are interop problems
Method Detail

getClsid

public static java.lang.String getClsid()
getClsid.


equals

public boolean equals(java.lang.Object o)
Compare this object with another

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class java.lang.Object

getJintegraDispatch

public com.esri.arcgis.interop.Dispatch getJintegraDispatch()
Deprecated. Internal use only.

Specified by:
getJintegraDispatch in interface com.esri.arcgis.interop.RemoteObjRef

release

public void release()
Release a JSONArray.

Specified by:
release in interface com.esri.arcgis.interop.RemoteObjRef

parseString

public void parseString(java.lang.String json)
                 throws java.io.IOException,
                        AutomationException
Parses JSON array from string into memory.

Specified by:
parseString in interface IJSONArray
Parameters:
json - The json (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

parseJSON

public void parseJSON(IJSONReader pReader)
               throws java.io.IOException,
                      AutomationException
Parses JSON array from IJSONReader into memory. Useful if you want to have random acces to just a part of a JSON.

Specified by:
parseJSON in interface IJSONArray
Parameters:
pReader - A reference to a com.esri.arcgis.system.IJSONReader (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCount

public int getCount()
             throws java.io.IOException,
                    AutomationException
Returns an array size.

Specified by:
getCount in interface IJSONArray
Returns:
The count
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getValue

public java.lang.Object getValue(int index)
                          throws java.io.IOException,
                                 AutomationException
Returns an array value at a given index. Returns E_INVALIDARG if index is out of bounds.

Specified by:
getValue in interface IJSONArray
Parameters:
index - The index (in)
Returns:
A Variant
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isValueNull

public boolean isValueNull(int index)
                    throws java.io.IOException,
                           AutomationException
Checks if an array value at a given index is NULL.

Specified by:
isValueNull in interface IJSONArray
Parameters:
index - The index (in)
Returns:
The value
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsDate

public boolean tryGetValueAsDate(int index,
                                 java.util.Date[] value)
                          throws java.io.IOException,
                                 AutomationException
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.

Specified by:
tryGetValueAsDate in interface IJSONArray
Parameters:
index - The index (in)
value - The value (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsBoolean

public boolean tryGetValueAsBoolean(int index,
                                    boolean[] value)
                             throws java.io.IOException,
                                    AutomationException
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.

Specified by:
tryGetValueAsBoolean in interface IJSONArray
Parameters:
index - The index (in)
value - The value (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsLong

public boolean tryGetValueAsLong(int index,
                                 int[] value)
                          throws java.io.IOException,
                                 AutomationException
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.

Specified by:
tryGetValueAsLong in interface IJSONArray
Parameters:
index - The index (in)
value - The value (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsDouble

public boolean tryGetValueAsDouble(int index,
                                   double[] value)
                            throws java.io.IOException,
                                   AutomationException
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.

Specified by:
tryGetValueAsDouble in interface IJSONArray
Parameters:
index - The index (in)
value - The value (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsString

public boolean tryGetValueAsString(int index,
                                   java.lang.String[] value)
                            throws java.io.IOException,
                                   AutomationException
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.

Specified by:
tryGetValueAsString in interface IJSONArray
Parameters:
index - The index (in)
value - The value (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsObject

public boolean tryGetValueAsObject(int index,
                                   IJSONObject[] value)
                            throws java.io.IOException,
                                   AutomationException
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.

Specified by:
tryGetValueAsObject in interface IJSONArray
Parameters:
index - The index (in)
value - A reference to a com.esri.arcgis.system.IJSONObject (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsArray

public boolean tryGetValueAsArray(int index,
                                  IJSONArray[] value)
                           throws java.io.IOException,
                                  AutomationException
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.

Specified by:
tryGetValueAsArray in interface IJSONArray
Parameters:
index - The index (in)
value - A reference to a com.esri.arcgis.system.IJSONArray (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

add

public void add(java.lang.Object value)
         throws java.io.IOException,
                AutomationException
Adds new variant value to the array.

Specified by:
add in interface IJSONArray
Parameters:
value - A Variant (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addDate

public void addDate(java.util.Date value)
             throws java.io.IOException,
                    AutomationException
Adds new DATE value to the array.

Specified by:
addDate in interface IJSONArray
Parameters:
value - The value (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addBoolean

public void addBoolean(boolean value)
                throws java.io.IOException,
                       AutomationException
Adds new boolean value to the array.

Specified by:
addBoolean in interface IJSONArray
Parameters:
value - The value (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addLong

public void addLong(int value)
             throws java.io.IOException,
                    AutomationException
Adds new long value to the array.

Specified by:
addLong in interface IJSONArray
Parameters:
value - The value (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addDouble

public void addDouble(double value)
               throws java.io.IOException,
                      AutomationException
Adds new double value to the array.

Specified by:
addDouble in interface IJSONArray
Parameters:
value - The value (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addString

public void addString(java.lang.String value)
               throws java.io.IOException,
                      AutomationException
Adds new string value to the array.

Specified by:
addString in interface IJSONArray
Parameters:
value - The value (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addNull

public void addNull()
             throws java.io.IOException,
                    AutomationException
Adds new null value to the array.

Specified by:
addNull in interface IJSONArray
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addJSONObject

public void addJSONObject(IJSONObject value)
                   throws java.io.IOException,
                          AutomationException
Adds new nested object to the array.

Specified by:
addJSONObject in interface IJSONArray
Parameters:
value - A reference to a com.esri.arcgis.system.IJSONObject (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addJSONArray

public void addJSONArray(IJSONArray value)
                  throws java.io.IOException,
                         AutomationException
Adds new nested array to the array.

Specified by:
addJSONArray in interface IJSONArray
Parameters:
value - A reference to a com.esri.arcgis.system.IJSONArray (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createMemberObject

public void createMemberObject(IJSONObject[] value)
                        throws java.io.IOException,
                               AutomationException
Creates and adds new member to the member collection. Returns E_FAIL if creation of the member fails.

Specified by:
createMemberObject in interface IJSONArray
Parameters:
value - A reference to a com.esri.arcgis.system.IJSONObject (out: use single element array)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createMemberArray

public void createMemberArray(IJSONArray[] value)
                       throws java.io.IOException,
                              AutomationException
Creates and adds new member to the member collection. Returns E_FAIL if creation of the member fails.

Specified by:
createMemberArray in interface IJSONArray
Parameters:
value - A reference to a com.esri.arcgis.system.IJSONArray (out: use single element array)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

toJSONString

public java.lang.String toJSONString(IPropertySet props)
                              throws java.io.IOException,
                                     AutomationException
Converts IJSONArray to JSON representation using IJSONWriter internally. 'props' parameter is to control IJSONWriter properties. It's safe to set it to NULL.

Specified by:
toJSONString in interface IJSONArray
Parameters:
props - A reference to a com.esri.arcgis.system.IPropertySet (in)
Returns:
The outStr
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

toJSON

public void toJSON(java.lang.String objectName,
                   IJSONWriter pWriter)
            throws java.io.IOException,
                   AutomationException
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.

Specified by:
toJSON in interface IJSONArray
Parameters:
objectName - The objectName (in)
pWriter - A reference to a com.esri.arcgis.system.IJSONWriter (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeValue

public void removeValue(int index)
                 throws java.io.IOException,
                        AutomationException
Remove a value from the member collection.

Specified by:
removeValue in interface IJSONArray
Parameters:
index - The index (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearAll

public void clearAll()
              throws java.io.IOException,
                     AutomationException
Removes all values.

Specified by:
clearAll in interface IJSONArray
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addDoubleEx

public void addDoubleEx(double value,
                        int precision)
                 throws java.io.IOException,
                        AutomationException
Adds new double value to the array. Stores precision for use in ToJSON and ToJSONString

Specified by:
addDoubleEx in interface IJSONArray
Parameters:
value - The value (in)
precision - The precision (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addInt64

public void addInt64(long value)
              throws java.io.IOException,
                     AutomationException
Adds new variant value to the array.

Specified by:
addInt64 in interface IJSONArray2
Parameters:
value - Signed 64-bit int (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addUInt64

public void addUInt64(long value)
               throws java.io.IOException,
                      AutomationException
Adds new variant value to the array.

Specified by:
addUInt64 in interface IJSONArray2
Parameters:
value - Unsigned 64-bit int (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsInt64

public boolean tryGetValueAsInt64(int index,
                                  long[] value)
                           throws java.io.IOException,
                                  AutomationException
Returns array value at a given index as LONGLONG. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Specified by:
tryGetValueAsInt64 in interface IJSONArray2
Parameters:
index - The index (in)
value - Signed 64-bit int (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsUInt64

public boolean tryGetValueAsUInt64(int index,
                                   long[] value)
                            throws java.io.IOException,
                                   AutomationException
Returns array value at a given index as ULONGLONG. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Specified by:
tryGetValueAsUInt64 in interface IJSONArray2
Parameters:
index - The index (in)
value - Unsigned 64-bit int (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

tryGetValueAsVariant

public boolean tryGetValueAsVariant(int index,
                                    int variantType,
                                    java.lang.Object[] value)
                             throws java.io.IOException,
                                    AutomationException
Returns array value at a given index as a VARIANT of the requested type. If index is out of bounds or type coercion fails, returns VARIANT_FALSE in 'success' parameter.

Specified by:
tryGetValueAsVariant in interface IJSONArray2
Parameters:
index - The index (in)
variantType - The variantType (in)
value - A Variant (out: use single element array)
Returns:
The success
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws java.io.IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.