public abstract class ResponseTransformer
extends java.lang.Object
DataSource.transformResponse(DSResponse, DSRequest, Object)
} when
instantiating a DataSource on the client. However when obtaining a DataSource instance from the server using DataSource.getDataSource(java.lang.String)
,
transformResponse(DSResponse, DSRequest, Object)
cannot be overridden and so the responseTransformer parameter can be passed to
DataSource.getDataSource(java.lang.String)
instead.Constructor and Description |
---|
ResponseTransformer() |
Modifier and Type | Method and Description |
---|---|
void |
defaultTransformResponse(DSResponse response,
DSRequest request,
java.lang.Object data) |
protected abstract void |
transformResponse(DSResponse response,
DSRequest request,
java.lang.Object data)
See the docs for
DataSource.transformResponse(DSResponse, DSRequest, Object) |
protected abstract void transformResponse(DSResponse response, DSRequest request, java.lang.Object data)
DataSource.transformResponse(DSResponse, DSRequest, Object)
response
- the responserequest
- the requestdata
- the raw data parameter. The type of this object depends on the specified dataFormat.
if the dataFormat is custom, this will be a String. Otherwise this will be a JavaScript object.
If the dataFormat is "json", the JavaScriptObject will be the raw JSON object(s) returned by the
web service. If dataFormat is XML the JavaScriptObject will be the raw XML document object.
Note that the JSOHelper
and
XMLTools
utility classes can be used to work with these raw objects.public void defaultTransformResponse(DSResponse response, DSRequest request, java.lang.Object data)