|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.system.JSONObject
public class JSONObject
Simplified JSON API coclass
Constructor Summary | |
---|---|
JSONObject()
Constructs a JSONObject using ArcGIS Engine. |
|
JSONObject(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. JSONObject theJSONObject = (JSONObject) obj; |
Method Summary | |
---|---|
void |
add(String name,
Object value)
Adds new member name-value pair to the member collection. |
void |
addBoolean(String name,
boolean value)
Adds new member name-value pair to the member collection. |
void |
addDate(String name,
Date value)
Adds new member name-value pair to the member collection. |
void |
addDouble(String name,
double value)
Adds new member name-value pair to the member collection. |
void |
addDoubleEx(String name,
double value,
int precision)
Adds new member name-value pair to the member collection. |
void |
addJSONArray(String name,
IJSONArray value)
Adds new member name-value pair to the member collection. |
void |
addJSONObject(String name,
IJSONObject value)
Adds new member name-value pair to the member collection. |
void |
addLong(String name,
int value)
Adds new member name-value pair to the member collection. |
void |
addNull(String name)
Adds new member with the value of null to the member collection. |
void |
addString(String name,
String value)
Adds new member name-value pair to the member collection. |
void |
clearAll()
Removes all members. |
void |
createMemberArray(String name,
IJSONArray[] value)
Creates and adds new member name-value pair to the member collection. |
void |
createMemberObject(String name,
IJSONObject[] value)
Creates and adds new member name-value pair to the member collection. |
boolean |
equals(Object o)
Compare this object with another |
static String |
getClsid()
getClsid. |
void |
getMemberAt(int index,
String[] name,
Object[] value)
Returns member name and value at a given index. |
int |
getMemberCount()
Returns size of member collection. |
int |
hashCode()
the hashcode for this object |
void |
interfaceSupportsErrorInfo(GUID riid)
interfaceSupportsErrorInfo |
boolean |
isCaseSensitiveNames()
Returns true if member name lookups are case-sensitive. |
boolean |
isValueNull(String name)
Returns VARIANT_TRUE if member is undefined or member's value is null. |
void |
makeValueNull(String name)
Make a designated member NULL. |
boolean |
memberExists(String name)
Checks if a member with the given name exists. |
void |
parseJSON(IJSONReader pReader)
Parses JSON object from IJSONReader into memory. |
void |
parseString(String json)
Parses JSON object from string into memory. |
void |
removeMember(String name)
Remove a member from the member collection. |
void |
setCaseSensitiveNames(boolean case_sensitive)
Returns true if member name lookups are case-sensitive. |
void |
toJSON(String objectName,
IJSONWriter pWriter)
Converts IJSONObject to JSON representation using provided IJSONWriter. |
String |
toJSONString(IPropertySet props)
Converts IJSONObject to JSON representation using IJSONWriter internally. |
boolean |
tryGetValue(String name,
Object[] value)
Returns member value for a given name. |
boolean |
tryGetValueAsArray(String name,
IJSONArray[] value)
Returns member value for a given name as IJSONArray. |
boolean |
tryGetValueAsBoolean(String name,
boolean[] value)
Returns member value for a given name as boolean. |
boolean |
tryGetValueAsDate(String name,
Date[] value)
Returns member value for a given name as DATE. |
boolean |
tryGetValueAsDouble(String name,
double[] value)
Returns member value for a given name as double. |
boolean |
tryGetValueAsLong(String name,
int[] value)
Returns member value for a given name as long. |
boolean |
tryGetValueAsObject(String name,
IJSONObject[] value)
Returns member value for a given name as IJSONObject. |
boolean |
tryGetValueAsString(String name,
String[] value)
Returns member value for a given name as string. |
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 |
---|
public JSONObject() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic JSONObject(Object obj) throws IOException
JSONObject theJSONObject = (JSONObject) obj;
obj
to JSONObject
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void parseString(String json) throws IOException, AutomationException
parseString
in interface IJSONObject
json
- The json (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void parseJSON(IJSONReader pReader) throws IOException, AutomationException
parseJSON
in interface IJSONObject
pReader
- A reference to a com.esri.arcgis.system.IJSONReader (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isCaseSensitiveNames() throws IOException, AutomationException
isCaseSensitiveNames
in interface IJSONObject
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setCaseSensitiveNames(boolean case_sensitive) throws IOException, AutomationException
setCaseSensitiveNames
in interface IJSONObject
case_sensitive
- The case_sensitive (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean memberExists(String name) throws IOException, AutomationException
memberExists
in interface IJSONObject
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isValueNull(String name) throws IOException, AutomationException
isValueNull
in interface IJSONObject
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getMemberCount() throws IOException, AutomationException
getMemberCount
in interface IJSONObject
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getMemberAt(int index, String[] name, Object[] value) throws IOException, AutomationException
getMemberAt
in interface IJSONObject
index
- The index (in)name
- The name (out: use single element array)value
- A Variant (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean tryGetValue(String name, Object[] value) throws IOException, AutomationException
tryGetValue
in interface IJSONObject
name
- The name (in)value
- A Variant (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean tryGetValueAsDate(String name, Date[] value) throws IOException, AutomationException
tryGetValueAsDate
in interface IJSONObject
name
- The name (in)value
- The value (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean tryGetValueAsBoolean(String name, boolean[] value) throws IOException, AutomationException
tryGetValueAsBoolean
in interface IJSONObject
name
- The name (in)value
- The value (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean tryGetValueAsLong(String name, int[] value) throws IOException, AutomationException
tryGetValueAsLong
in interface IJSONObject
name
- The name (in)value
- The value (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean tryGetValueAsDouble(String name, double[] value) throws IOException, AutomationException
tryGetValueAsDouble
in interface IJSONObject
name
- The name (in)value
- The value (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean tryGetValueAsString(String name, String[] value) throws IOException, AutomationException
tryGetValueAsString
in interface IJSONObject
name
- The name (in)value
- The value (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean tryGetValueAsObject(String name, IJSONObject[] value) throws IOException, AutomationException
tryGetValueAsObject
in interface IJSONObject
name
- The name (in)value
- A reference to a com.esri.arcgis.system.IJSONObject (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean tryGetValueAsArray(String name, IJSONArray[] value) throws IOException, AutomationException
tryGetValueAsArray
in interface IJSONObject
name
- The name (in)value
- A reference to a com.esri.arcgis.system.IJSONArray (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addDate(String name, Date value) throws IOException, AutomationException
addDate
in interface IJSONObject
name
- The name (in)value
- The value (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addBoolean(String name, boolean value) throws IOException, AutomationException
addBoolean
in interface IJSONObject
name
- The name (in)value
- The value (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addLong(String name, int value) throws IOException, AutomationException
addLong
in interface IJSONObject
name
- The name (in)value
- The value (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addDouble(String name, double value) throws IOException, AutomationException
addDouble
in interface IJSONObject
name
- The name (in)value
- The value (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addString(String name, String value) throws IOException, AutomationException
addString
in interface IJSONObject
name
- The name (in)value
- The value (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addNull(String name) throws IOException, AutomationException
addNull
in interface IJSONObject
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void add(String name, Object value) throws IOException, AutomationException
add
in interface IJSONObject
name
- The name (in)value
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addJSONObject(String name, IJSONObject value) throws IOException, AutomationException
addJSONObject
in interface IJSONObject
name
- The name (in)value
- A reference to a com.esri.arcgis.system.IJSONObject (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addJSONArray(String name, IJSONArray value) throws IOException, AutomationException
addJSONArray
in interface IJSONObject
name
- The name (in)value
- A reference to a com.esri.arcgis.system.IJSONArray (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void createMemberObject(String name, IJSONObject[] value) throws IOException, AutomationException
createMemberObject
in interface IJSONObject
name
- The name (in)value
- A reference to a com.esri.arcgis.system.IJSONObject (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void createMemberArray(String name, IJSONArray[] value) throws IOException, AutomationException
createMemberArray
in interface IJSONObject
name
- The name (in)value
- A reference to a com.esri.arcgis.system.IJSONArray (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void makeValueNull(String name) throws IOException, AutomationException
makeValueNull
in interface IJSONObject
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String toJSONString(IPropertySet props) throws IOException, AutomationException
toJSONString
in interface IJSONObject
props
- A reference to a com.esri.arcgis.system.IPropertySet (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void toJSON(String objectName, IJSONWriter pWriter) throws IOException, AutomationException
toJSON
in interface IJSONObject
objectName
- The objectName (in)pWriter
- A reference to a com.esri.arcgis.system.IJSONWriter (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void removeMember(String name) throws IOException, AutomationException
removeMember
in interface IJSONObject
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void clearAll() throws IOException, AutomationException
clearAll
in interface IJSONObject
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addDoubleEx(String name, double value, int precision) throws IOException, AutomationException
addDoubleEx
in interface IJSONObject
name
- The name (in)value
- The value (in)precision
- The precision (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void interfaceSupportsErrorInfo(GUID riid) throws IOException, AutomationException
Indicates whether the interface supports IErrorInfo.
interfaceSupportsErrorInfo
in interface ISupportErrorInfo
riid
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |