com.esri.arcgis.geodatabase
Class JSONSerializerGdb

java.lang.Object
  extended by com.esri.arcgis.geodatabase.JSONSerializerGdb
All Implemented Interfaces:
IExternalSerializerGdb, com.esri.arcgis.interop.RemoteObjRef, IExternalSerializer, IJSONSerializer, ISupportErrorInfo, Serializable

public class JSONSerializerGdb
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IJSONSerializer, IExternalSerializerGdb, ISupportErrorInfo

High-level object serializer into JSON coclass.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
JSONSerializerGdb()
          Constructs a JSONSerializerGdb using ArcGIS Engine.
JSONSerializerGdb(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
JSONSerializerGdb theJSONSerializerGdb = (JSONSerializerGdb) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 byte[] getErrorObject(String propname, int code, String message, IStringArray details)
          Convenience method.
 IJSONWriter getWriter()
          Obtains JSON Writer.
 int hashCode()
          the hashcode for this object
 void initSerializer(IJSONWriter pWriter, IPropertySet pProps)
          Writes serialization options.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void writeErrorObject(String propname, int code, String message, IStringArray details)
          Writes error object.
 void writeGeometry(String propname, IGeometry pGeom)
          Writes geometry object.
 void writeObject(Object pUnk, IPropertySet pProps)
          Serializes an object.
 void writeRecordSet(String propname, IRecordSet pRecordset, IGeometryResultOptions pGeomOpt)
          Writes feature recordset.
 void writeRow(String propname, IRow pRow, IFields pFields, int[] rowFieldIndexes, IGeometryResultOptions pGeomOpt)
          Writes feature row object
 void writeSpatialReference(String propname, ISpatialReference pSR)
          Writes spatial reference object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

JSONSerializerGdb

public JSONSerializerGdb()
                  throws IOException,
                         UnknownHostException
Constructs a JSONSerializerGdb using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

JSONSerializerGdb

public JSONSerializerGdb(Object obj)
                  throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
JSONSerializerGdb theJSONSerializerGdb = (JSONSerializerGdb) obj;

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

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

getClsid

public static String getClsid()
getClsid.


equals

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

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getWriter

public IJSONWriter getWriter()
                      throws IOException,
                             AutomationException
Obtains JSON Writer.

Product Availability

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

Specified by:
getWriter in interface IJSONSerializer
Returns:
A reference to a com.esri.arcgis.system.IJSONWriter
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initSerializer

public void initSerializer(IJSONWriter pWriter,
                           IPropertySet pProps)
                    throws IOException,
                           AutomationException
Writes serialization options.

Product Availability

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

Specified by:
initSerializer in interface IJSONSerializer
Parameters:
pWriter - A reference to a com.esri.arcgis.system.IJSONWriter (in)
pProps - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeObject

public void writeObject(Object pUnk,
                        IPropertySet pProps)
                 throws IOException,
                        AutomationException
Serializes an object.

Product Availability

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

Specified by:
writeObject in interface IExternalSerializer
Parameters:
pUnk - A reference to another Object (IUnknown) (in)
pProps - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeSpatialReference

public void writeSpatialReference(String propname,
                                  ISpatialReference pSR)
                           throws IOException,
                                  AutomationException
Writes spatial reference object. Pass NULL as propname to write standalone JSON object.

Product Availability

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

Specified by:
writeSpatialReference in interface IExternalSerializerGdb
Parameters:
propname - The propname (in)
pSR - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeGeometry

public void writeGeometry(String propname,
                          IGeometry pGeom)
                   throws IOException,
                          AutomationException
Writes geometry object.

Product Availability

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

Specified by:
writeGeometry in interface IExternalSerializerGdb
Parameters:
propname - The propname (in)
pGeom - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeRow

public void writeRow(String propname,
                     IRow pRow,
                     IFields pFields,
                     int[] rowFieldIndexes,
                     IGeometryResultOptions pGeomOpt)
              throws IOException,
                     AutomationException
Writes feature row object

Product Availability

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

Specified by:
writeRow in interface IExternalSerializerGdb
Parameters:
propname - The propname (in)
pRow - A reference to a com.esri.arcgis.geodatabase.IRow (in)
pFields - A reference to a com.esri.arcgis.geodatabase.IFields (in)
rowFieldIndexes - The rowFieldIndexes (in)
pGeomOpt - A reference to a com.esri.arcgis.geodatabase.IGeometryResultOptions (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeRecordSet

public void writeRecordSet(String propname,
                           IRecordSet pRecordset,
                           IGeometryResultOptions pGeomOpt)
                    throws IOException,
                           AutomationException
Writes feature recordset.

Product Availability

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

Specified by:
writeRecordSet in interface IExternalSerializerGdb
Parameters:
propname - The propname (in)
pRecordset - A reference to a com.esri.arcgis.geodatabase.IRecordSet (in)
pGeomOpt - A reference to a com.esri.arcgis.geodatabase.IGeometryResultOptions (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeErrorObject

public void writeErrorObject(String propname,
                             int code,
                             String message,
                             IStringArray details)
                      throws IOException,
                             AutomationException
Writes error object.

Product Availability

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

Specified by:
writeErrorObject in interface IExternalSerializerGdb
Parameters:
propname - The propname (in)
code - The code (in)
message - The message (in)
details - A reference to a com.esri.arcgis.system.IStringArray (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getErrorObject

public byte[] getErrorObject(String propname,
                             int code,
                             String message,
                             IStringArray details)
                      throws IOException,
                             AutomationException
Convenience method. Creates and returns error object as byte SAFEARRAY.

Product Availability

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

Specified by:
getErrorObject in interface IExternalSerializerGdb
Parameters:
propname - The propname (in)
code - The code (in)
message - The message (in)
details - A reference to a com.esri.arcgis.system.IStringArray (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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