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 | ||
getOptionalProperty(typeName:String, decodedObject:Object, propertyName:String, propertyType:Class = null, 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, propertyType:Class = null):* [static]
Tests a property of a JSON-decoded object to be specified and gets it. | ParseUtils |
ensureGPResult | () | method |
public static function ensureGPResult(decodedObject:Object):void
Ensures 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):void
Ensures 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.
|
getOptionalProperty | () | method |
public static function getOptionalProperty(typeName:String, decodedObject:Object, propertyName:String, propertyType:Class = null, defaultValue:*):*
Gets a value of the given property of a JSON-decoded object or a default value if the property value is missing.
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 (case insensitive).
| |
propertyType:Class (default = null ) — Expected type of property.
| |
defaultValue:* (default = NaN ) — A default value.
|
* — The property value.
|
testAndGetProperty | () | method |
public static function testAndGetProperty(typeName:String, decodedObject:Object, propertyName:String, propertyType:Class = null):*
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 (case insensitive).
| |
propertyType:Class (default = null ) — Expected type of property.
|
* — Property value.
|
BAResponseError — The property is absent or has a wrong type.
|