Package | com.esri.bacore.client |
Class | public class BAClient |
Inheritance | BAClient AbstractClient Object |
Subclasses | BAOnlineClient, BAServerClient |
A BAClient instance decodes the result with the ArcGIS JSON decoder and
provides additional conversion of the result to an object of a specific type.
It does this by applying a result processor registered for the result type requested.
After that the result object can be additionally post-processed by the task parameters
instance if it implements the IResultProcessor
interface. Finally,
a result handler function from the calling Community Analyst Task can do additional
transformations of the result object before returning it to a client.
See also
Method | Defined By | ||
---|---|---|---|
BAClient(url:Object = null)
Creates a new instance of the BAClient class. | BAClient | ||
combineUrl(baseUrl:String, urlSuffix:String):String [static]
Combines a base URL with a suffix. | AbstractClient | ||
dispatchEventOnTask(event:Event, asyncToken:AsyncToken):void [static]
Dispatches an event on the requester task associated with the given async token. | AbstractClient | ||
notifyOnError(error:Error, asyncToken:AsyncToken):void [static]
Creates fault event from an error and notifies async token responders using the
notifyOnFault method. | AbstractClient | ||
notifyOnFault(fault:*, asyncToken:AsyncToken):void [static]
Notifies async token responders on fault and dispatches the fault event on the requester task. | AbstractClient | ||
notifyOnResult(result:*, asyncToken:AsyncToken):void [static]
Notifies async token responders on result and dispatches an event on the requester task. | AbstractClient | ||
send(task:IEventDispatcher, logError:Function, urlSuffix:String, urlVariables:URLVariables, responder:IResponder, operation:Function, timeout:Number = -1, disableCaching:Boolean = false, url:String = null):AsyncToken
Sends a request to HTTP service. | AbstractClient |
Method | Defined By | ||
---|---|---|---|
addResultProcessor(resultType:BAResultType, processor:Function):void
Registers a processor of a result which will convert a JSON decoded object
to an object of the specified type. | BAClient |
BAClient | () | Constructor |
public function BAClient(url:Object = null)
Creates a new instance of the BAClient class.
Parametersurl:Object (default = null ) — The base URL of the client.
|
addResultProcessor | () | method |
protected function addResultProcessor(resultType:BAResultType, processor:Function):void
Registers a processor of a result which will convert a JSON decoded object to an object of the specified type.
A processor signature is processor(asyncToken:AsyncToken):void
.
It gets the asyncToken.resultObject
property value containing
the result object decoded from JSON, converts it to an instance of the required
result type, and assigns the result back to the asyncToken.resultObject
property. If conversion cannot be done for some reason, the processor can
throw an error or assign null to the asyncToken.resultObject
property.
Parameters
resultType:BAResultType — A result type the result processor will be registered for.
| |
processor:Function — A result processor function.
|