| Package | com.esri.bacore.client |
| Class | public class ParseUtils |
| Inheritance | ParseUtils Object |
| Subclasses | GPResultParsers, GPResultProcessors |
| Method | Defined By | ||
|---|---|---|---|
ensureGPResult(decodedObject:Object):void [static]
Ensures that the JSON-decoded object is a GPResult object. | ParseUtils | ||
ensureValidGPDataType(decodedObject:Object, value:String):void [static]
Ensures that the dataType property value of the specified JSON-decoded GPResult object
is equal to the given value. | ParseUtils | ||
getProperty(decodedObject:Object, propertyName:String, ignoreCase:Boolean = false, defaultValue:*):* [static]
Gets a value of the given property of a JSON-decoded object or a default value
if the property value is missing. | ParseUtils | ||
testAndGetProperty(typeName:String, decodedObject:Object, propertyName:String):* [static]
Tests a property of a JSON-decoded object to be specified and gets it. | ParseUtils | ||
| ensureGPResult | () | method |
public static function ensureGPResult(decodedObject:Object):voidEnsures that the JSON-decoded object is a GPResult object.
Parameters
decodedObject:Object — A GPResult object decoded from JSON.
|
BAResponseError — The JSON-decoded object has wrong contents.
|
| ensureValidGPDataType | () | method |
public static function ensureValidGPDataType(decodedObject:Object, value:String):voidEnsures that the dataType property value of the specified JSON-decoded GPResult object is equal to the given value.
Parameters
decodedObject:Object — A GPResult object decoded from JSON.
| |
value:String — A value required.
|
BAResponseError — GPResult object has a wrong data type.
|
| getProperty | () | method |
public static function getProperty(decodedObject:Object, propertyName:String, ignoreCase:Boolean = false, defaultValue:*):*
Gets a value of the given property of a JSON-decoded object or a default value
if the property value is missing. If ignoreCase is true,
the method tries at first to get a property with the given name and after that
finds a property in ignore case mode.
Parameters
decodedObject:Object — A JSON-decoded object.
| |
propertyName:String — A property of the JSON-decoded object.
| |
ignoreCase:Boolean (default = false) — Ignore letter case or not.
| |
defaultValue:* (default = NaN) — A default value.
|
* — The property value.
|
| testAndGetProperty | () | method |
public static function testAndGetProperty(typeName:String, decodedObject:Object, propertyName:String):*Tests a property of a JSON-decoded object to be specified and gets it.
Parameters
typeName:String — A name of type corresponding to this object.
| |
decodedObject:Object — A JSON-decoded object.
| |
propertyName:String — A property of the JSON-decoded object to be tested.
|
* — Property value.
|
BAResponseError — The property is absent.
|