com.esri.arcgis.system
Class JSONReader

java.lang.Object
  extended by com.esri.arcgis.system.JSONReader
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IJSONReader, IJSONReader2, IJSONReader3, ISupportErrorInfo, java.io.Serializable

public class JSONReader
extends java.lang.Object
implements com.esri.arcgis.interop.RemoteObjRef, IJSONReader, IJSONReader2, IJSONReader3, ISupportErrorInfo

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

Description 'A sequential JSON Reader.' 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.IJSONReader3
IID, IID14dff1e9_0100_4ab9_9e4c_aa1dfafd6774, xxDummy
 
Fields inherited from interface com.esri.arcgis.system.IJSONReader2
IID2c573605_c449_47e3_a483_f441192840fa
 
Fields inherited from interface com.esri.arcgis.system.IJSONReader
IID48105a80_e0dc_4d69_bb61_3df74cafa52c
 
Fields inherited from interface com.esri.arcgis.system.ISupportErrorInfo
IID, IIDdf0b3d60_548f_101b_8e65_08002b2bd119, xxDummy
 
Constructor Summary
JSONReader()
          Constructs a JSONReader using ArcGIS Engine.
JSONReader(java.lang.Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
JSONReader theJSONReader = (JSONReader) obj;
 
Method Summary
 boolean equals(java.lang.Object o)
          Compare this object with another
 int findProperties(IStringArray propnames)
          Reads current object until one of property names matches.
 boolean findProperty(java.lang.String propname)
          Reads current object until property name matches or object ends.
static java.lang.String getClsid()
          getClsid.
 int getCurrentTokenType()
          Obtains type of current token.
 com.esri.arcgis.interop.Dispatch getJintegraDispatch()
          Deprecated. Internal use only.
 IStream getStream()
          Obtains underlying stream.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 boolean isBoolean()
          Indicates true if current token is a property value or array value of boolean type.
 boolean isEndOfArray()
          Indicates true if current token is ']'.
 boolean isEndOfObject()
          Indicates true if current token is '}'.
 boolean isNull()
          Indicates true if current token is a property value or array value and equals to null.
 boolean isNumber()
          Indicates true if current token is a property value or array value of numeric type.
 boolean isStartOfArray()
          Indicates true if current token is '['.
 boolean isStartOfObject()
          Indicates true if current token is '{'.
 boolean isString()
          Indicates true if current token is a property value or array value of type string.
 java.lang.Object parseJSONString(java.lang.String json)
          Parses JSON string into memory.
 void read()
          Reads next JSON token.
 void readFrom(IStream inputStream)
          Specifies input stream.
 void readFromString(java.lang.String text)
          Specifies input as string.
 java.lang.String readPropertyName()
          Obtains property name.
 java.lang.Object readValue()
          Obtains array or property value as Variant.
 boolean readValueAsBoolean()
          Obtains array or property value as boolean.
 java.util.Date readValueAsDate()
          Obtains property or array value as date.
 double readValueAsDouble()
          Obtains property or array value as number.
 long readValueAsInt64()
          Obtains property or array value as number.
 int readValueAsLong()
          Obtains property or array value as number.
 java.lang.String readValueAsString()
          Obtains property or array value as string.
 long readValueAsUInt64()
          Obtains property or array value as number.
 void readValueEx(java.lang.Object[] pVal, int[] precision)
          Obtains array or property value as Variant along with precision if it is a double.
 void release()
          Release a JSONReader.
 void removeAllBookmarks()
          Removes all bookmarks.
 void removeBookmark(java.lang.String name)
          Moves the reader back to a token that has a bookmark with the given name.
 void returnToBookmark(java.lang.String name)
          Moves the reader back to a token that has a bookmark with the given name.
 void setBookmark(java.lang.String name)
          Creates a bookmark on the current token and assigns it a name.
 void skipUntilArrayEnds()
          Skips the rest of the current object, including closing bracket.
 void skipUntilObjectEnds()
          Skips the rest of the current object, including closing bracket.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONReader

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

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

JSONReader

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

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

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 JSONReader.

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

readFrom

public void readFrom(IStream inputStream)
              throws java.io.IOException,
                     AutomationException
Specifies input stream.

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

readFromString

public void readFromString(java.lang.String text)
                    throws java.io.IOException,
                           AutomationException
Specifies input as string.

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

getStream

public IStream getStream()
                  throws java.io.IOException,
                         AutomationException
Obtains underlying stream.

Specified by:
getStream in interface IJSONReader
Returns:
A reference to a com.esri.arcgis.system.IStream
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

read

public void read()
          throws java.io.IOException,
                 AutomationException
Reads next JSON token.

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

getCurrentTokenType

public int getCurrentTokenType()
                        throws java.io.IOException,
                               AutomationException
Obtains type of current token.

Specified by:
getCurrentTokenType in interface IJSONReader
Returns:
A com.esri.arcgis.system.JSONTokenType constant
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isStartOfObject

public boolean isStartOfObject()
                        throws java.io.IOException,
                               AutomationException
Indicates true if current token is '{'.

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

isEndOfObject

public boolean isEndOfObject()
                      throws java.io.IOException,
                             AutomationException
Indicates true if current token is '}'.

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

isStartOfArray

public boolean isStartOfArray()
                       throws java.io.IOException,
                              AutomationException
Indicates true if current token is '['.

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

isEndOfArray

public boolean isEndOfArray()
                     throws java.io.IOException,
                            AutomationException
Indicates true if current token is ']'.

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

isString

public boolean isString()
                 throws java.io.IOException,
                        AutomationException
Indicates true if current token is a property value or array value of type string.

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

isNumber

public boolean isNumber()
                 throws java.io.IOException,
                        AutomationException
Indicates true if current token is a property value or array value of numeric type.

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

isBoolean

public boolean isBoolean()
                  throws java.io.IOException,
                         AutomationException
Indicates true if current token is a property value or array value of boolean type.

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

isNull

public boolean isNull()
               throws java.io.IOException,
                      AutomationException
Indicates true if current token is a property value or array value and equals to null.

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

readValue

public java.lang.Object readValue()
                           throws java.io.IOException,
                                  AutomationException
Obtains array or property value as Variant. Advances to the next token.

Specified by:
readValue in interface IJSONReader
Returns:
A Variant
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

readPropertyName

public java.lang.String readPropertyName()
                                  throws java.io.IOException,
                                         AutomationException
Obtains property name. Advances to the next token.

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

readValueAsString

public java.lang.String readValueAsString()
                                   throws java.io.IOException,
                                          AutomationException
Obtains property or array value as string. Advances to the next token. If property value cannot be coerced to string, returns E_FAIL.

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

readValueAsLong

public int readValueAsLong()
                    throws java.io.IOException,
                           AutomationException
Obtains property or array value as number. Advances to the next token. If property value cannot be coerced to long, returns E_FAIL.

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

readValueAsDouble

public double readValueAsDouble()
                         throws java.io.IOException,
                                AutomationException
Obtains property or array value as number. Advances to the next token. If property value cannot be coerced to double, returns E_FAIL.

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

readValueAsBoolean

public boolean readValueAsBoolean()
                           throws java.io.IOException,
                                  AutomationException
Obtains array or property value as boolean. Advances to the next token. If property value cannot be coerced to boolean, returns E_FAIL.

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

readValueAsDate

public java.util.Date readValueAsDate()
                               throws java.io.IOException,
                                      AutomationException
Obtains property or array value as date. Advances to the next token. If property value cannot be coerced to datetime, returns E_FAIL.

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

findProperty

public boolean findProperty(java.lang.String propname)
                     throws java.io.IOException,
                            AutomationException
Reads current object until property name matches or object ends. Case is ignored.

Specified by:
findProperty in interface IJSONReader
Parameters:
propname - The propname (in)
Returns:
The found
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findProperties

public int findProperties(IStringArray propnames)
                   throws java.io.IOException,
                          AutomationException
Reads current object until one of property names matches. Case is ignored. Return value is an index of property name that matched, otherwise -1.

Specified by:
findProperties in interface IJSONReader
Parameters:
propnames - A reference to a com.esri.arcgis.system.IStringArray (in)
Returns:
The index
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

skipUntilObjectEnds

public void skipUntilObjectEnds()
                         throws java.io.IOException,
                                AutomationException
Skips the rest of the current object, including closing bracket.

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

skipUntilArrayEnds

public void skipUntilArrayEnds()
                        throws java.io.IOException,
                               AutomationException
Skips the rest of the current object, including closing bracket.

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

parseJSONString

public java.lang.Object parseJSONString(java.lang.String json)
                                 throws java.io.IOException,
                                        AutomationException
Parses JSON string into memory. Returns either IJSONObject or IJSONArray in a 'root' parameter. Doesn't change state of existing IJSONReader2 instance.

Specified by:
parseJSONString in interface IJSONReader2
Parameters:
json - The json (in)
Returns:
A reference to another Object (IUnknown)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setBookmark

public void setBookmark(java.lang.String name)
                 throws java.io.IOException,
                        AutomationException
Creates a bookmark on the current token and assigns it a name. Only works if you use ReadFromString(), otherwise returns E_FAIL.

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

returnToBookmark

public void returnToBookmark(java.lang.String name)
                      throws java.io.IOException,
                             AutomationException
Moves the reader back to a token that has a bookmark with the given name.

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

removeBookmark

public void removeBookmark(java.lang.String name)
                    throws java.io.IOException,
                           AutomationException
Moves the reader back to a token that has a bookmark with the given name.

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

removeAllBookmarks

public void removeAllBookmarks()
                        throws java.io.IOException,
                               AutomationException
Removes all bookmarks.

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

readValueEx

public void readValueEx(java.lang.Object[] pVal,
                        int[] precision)
                 throws java.io.IOException,
                        AutomationException
Obtains array or property value as Variant along with precision if it is a double. Advances to the next token.

Specified by:
readValueEx in interface IJSONReader2
Parameters:
pVal - A Variant (out: use single element array)
precision - The precision (out: use single element array)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

readValueAsInt64

public long readValueAsInt64()
                      throws java.io.IOException,
                             AutomationException
Obtains property or array value as number. Advances to the next token. If property value cannot be coerced to long, returns E_FAIL.

Specified by:
readValueAsInt64 in interface IJSONReader3
Returns:
Signed 64-bit int
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

readValueAsUInt64

public long readValueAsUInt64()
                       throws java.io.IOException,
                              AutomationException
Obtains property or array value as number. Advances to the next token. If property value cannot be coerced to long, returns E_FAIL.

Specified by:
readValueAsUInt64 in interface IJSONReader3
Returns:
Unsigned 64-bit int
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.