Packagecom.esri.bacore.client
Classpublic final class ConversionUtils
InheritanceConversionUtils Inheritance Object

The ConversionUtils class contains a collection of utility methods useful in JSON encoding/decoding and in the parsing process.



Public Methods
 MethodDefined By
  
analysisExtentToObject(extent:Geometry):Object
[static] Ensures that analysis extent is either an Extent or Polygon type object and attaches it to the "Extent" property of the result object.
ConversionUtils
  
featureSetToObject(featureSet:FeatureSet):Object
[static] Converts a value of the FeatureSet type to a value of the Object type.
ConversionUtils
  
objectToFeatureSet(decodedObject:Object):FeatureSet
[static] Converts a JSON-decoded object to an instance of the FeatureSet type.
ConversionUtils
  
objectToMapImage(decodedObject:Object):MapImage
[static] Converts a JSON-decoded object to an instance of the MapImage type.
ConversionUtils
Method Detail
analysisExtentToObject()method
public static function analysisExtentToObject(extent:Geometry):Object

Ensures that analysis extent is either an Extent or Polygon type object and attaches it to the "Extent" property of the result object. This method is used for conversion the analysis extent to JSON. The input parameter must be non-null.

Parameters

extent:Geometry — A geometry object of either Extent ot Polygon type.

Returns
Object — An object wrapping the analysis extent.

Throws
BARequestError — Wrong type of the Geometry object.
featureSetToObject()method 
public static function featureSetToObject(featureSet:FeatureSet):Object

Converts a value of the FeatureSet type to a value of the Object type. This method is used for later conversion of the object to the JSON string. The result object receives a resticted part of the FeatureSet, namely the values of geometryType, spatialReference, and features properties.

Parameters

featureSet:FeatureSet — A feature set to be converted to Object.

Returns
Object — A new object containing properties of the FeatureSet need for serialization to JSON.
objectToFeatureSet()method 
public static function objectToFeatureSet(decodedObject:Object):FeatureSet

Converts a JSON-decoded object to an instance of the FeatureSet type.

Parameters

decodedObject:Object — JSON-decoded object containing a feature set.

Returns
FeatureSet — A new instance of the FeatureSet type or null.
objectToMapImage()method 
public static function objectToMapImage(decodedObject:Object):MapImage

Converts a JSON-decoded object to an instance of the MapImage type.

Parameters

decodedObject:Object — JSON-decoded object containing a map image.

Returns
MapImage — A new instance of the MapImage type or null.