com.esri.arcgis.system
Interface IJSONWriter

All Superinterfaces:
Serializable
All Known Implementing Classes:
JSONWriter

public interface IJSONWriter
extends Serializable

Provides access to members that control the sequential writing of JSON.

Product Availability

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


Method Summary
 void endArray()
          Ends an array.
 void endObject()
          Ends writing of an object.
 IStream getStream()
          Obtains underlying stream.
 byte[] getStringBuffer()
          Obtains copy of string buffer.
 void setFormatted(boolean value)
          Writes 'pretty' formatting on or off.
 void setIndent(int value)
          Writes indent for 'pretty' formatting.
 void startArray(String name)
          Starts an array.
 void startObject(String name)
          Starts writing an object.
 void writeBinary(String name, byte[] value)
          Writes a byte array.
 void writeBinaryVal(byte[] value)
          Writes a byte array.
 void writeBoolean(String name, boolean value)
          Writes a boolean.
 void writeBooleanVal(boolean value)
          Writes a boolean in array.
 void writeByte(String name, byte value)
          Writes a byte.
 void writeByteVal(byte value)
          Writes a byte in array.
 void writeDate(String name, Date value, boolean asString)
          Writes a date.
 void writeDateVal(Date value, boolean asString)
          Writes a date in array.
 void writeDouble(String name, double value)
          Writes a double.
 void writeDoubleVal(double value)
          Writes a double in array.
 void writeFloat(String name, float value)
          Writes a float.
 void writeFloatVal(float value)
          Writes a float in array.
 void writeInteger(String name, int value)
          Writes an integer.
 void writeIntegerVal(int value)
          Writes an integer in array.
 void writeNull(String name)
          Writes null property.
 void writeNullVal()
          Writes null value in array.
 void writeShort(String name, short value)
          Writes a short.
 void writeShortVal(short value)
          Writes a short int in array.
 void writeString(String name, String value)
          Writes a string property.
 void writeStringVal(String value)
          Writes a string in array.
 void writeTo(IStream outputStream)
          Specifies output JSON stream.
 void writeToString()
          Redirects writing to internal string buffer.
 void writeVariant(String name, Object value)
          Writes a variant valued property.
 void writeVariantVal(Object value)
          Writes a variant in array.
 

Method Detail

writeTo

void writeTo(IStream outputStream)
             throws IOException,
                    AutomationException
Specifies output JSON stream.

Product Availability

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

Parameters:
outputStream - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeToString

void writeToString()
                   throws IOException,
                          AutomationException
Redirects writing to internal string buffer.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getStringBuffer

byte[] getStringBuffer()
                       throws IOException,
                              AutomationException
Obtains copy of string buffer. Encoding is UTF8.

Product Availability

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

Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getStream

IStream getStream()
                  throws IOException,
                         AutomationException
Obtains underlying stream. If WriteTo() is not called yet, will return NULL. Also will return NULL if WriteToString() was called.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.system.IStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFormatted

void setFormatted(boolean value)
                  throws IOException,
                         AutomationException
Writes 'pretty' formatting on or off.

Product Availability

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

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setIndent

void setIndent(int value)
               throws IOException,
                      AutomationException
Writes indent for 'pretty' formatting. Default is 2.

Product Availability

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

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startObject

void startObject(String name)
                 throws IOException,
                        AutomationException
Starts writing an object.

Product Availability

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

Parameters:
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

endObject

void endObject()
               throws IOException,
                      AutomationException
Ends writing of an object.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startArray

void startArray(String name)
                throws IOException,
                       AutomationException
Starts an array.

Product Availability

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

Parameters:
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

endArray

void endArray()
              throws IOException,
                     AutomationException
Ends an array.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeVariant

void writeVariant(String name,
                  Object value)
                  throws IOException,
                         AutomationException
Writes a variant valued property.

Product Availability

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

Parameters:
name - The name (in)
value - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeString

void writeString(String name,
                 String value)
                 throws IOException,
                        AutomationException
Writes a string property.

Product Availability

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

Parameters:
name - The name (in)
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeBoolean

void writeBoolean(String name,
                  boolean value)
                  throws IOException,
                         AutomationException
Writes a boolean.

Product Availability

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

Parameters:
name - The name (in)
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeByte

void writeByte(String name,
               byte value)
               throws IOException,
                      AutomationException
Writes a byte.

Product Availability

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

Parameters:
name - The name (in)
value - An unsigned byte (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeShort

void writeShort(String name,
                short value)
                throws IOException,
                       AutomationException
Writes a short.

Product Availability

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

Parameters:
name - The name (in)
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeInteger

void writeInteger(String name,
                  int value)
                  throws IOException,
                         AutomationException
Writes an integer.

Product Availability

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

Parameters:
name - The name (in)
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeFloat

void writeFloat(String name,
                float value)
                throws IOException,
                       AutomationException
Writes a float.

Product Availability

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

Parameters:
name - The name (in)
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeDouble

void writeDouble(String name,
                 double value)
                 throws IOException,
                        AutomationException
Writes a double.

Product Availability

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

Parameters:
name - The name (in)
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeDate

void writeDate(String name,
               Date value,
               boolean asString)
               throws IOException,
                      AutomationException
Writes a date.

Product Availability

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

Parameters:
name - The name (in)
value - The value (in)
asString - The asString (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeBinary

void writeBinary(String name,
                 byte[] value)
                 throws IOException,
                        AutomationException
Writes a byte array.

Product Availability

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

Parameters:
name - The name (in)
value - An unsigned byte (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeNull

void writeNull(String name)
               throws IOException,
                      AutomationException
Writes null property.

Product Availability

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

Parameters:
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeVariantVal

void writeVariantVal(Object value)
                     throws IOException,
                            AutomationException
Writes a variant in array.

Product Availability

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

Parameters:
value - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeStringVal

void writeStringVal(String value)
                    throws IOException,
                           AutomationException
Writes a string in array.

Product Availability

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

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeBooleanVal

void writeBooleanVal(boolean value)
                     throws IOException,
                            AutomationException
Writes a boolean in array.

Product Availability

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

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeByteVal

void writeByteVal(byte value)
                  throws IOException,
                         AutomationException
Writes a byte in array.

Product Availability

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

Parameters:
value - An unsigned byte (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeShortVal

void writeShortVal(short value)
                   throws IOException,
                          AutomationException
Writes a short int in array.

Product Availability

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

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeIntegerVal

void writeIntegerVal(int value)
                     throws IOException,
                            AutomationException
Writes an integer in array.

Product Availability

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

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeFloatVal

void writeFloatVal(float value)
                   throws IOException,
                          AutomationException
Writes a float in array.

Product Availability

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

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeDoubleVal

void writeDoubleVal(double value)
                    throws IOException,
                           AutomationException
Writes a double in array.

Product Availability

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

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeDateVal

void writeDateVal(Date value,
                  boolean asString)
                  throws IOException,
                         AutomationException
Writes a date in array.

Product Availability

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

Parameters:
value - The value (in)
asString - The asString (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeBinaryVal

void writeBinaryVal(byte[] value)
                    throws IOException,
                           AutomationException
Writes a byte array.

Product Availability

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

Parameters:
value - An unsigned byte (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeNullVal

void writeNullVal()
                  throws IOException,
                         AutomationException
Writes null value in array.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.