Helper object for the format calls to wrap the JSON response in a JSONP function if requested. Used for code dedupe. @param obj The object to serialize @return A ChannelBuffer to pass on to the query @throws JSONException if serialization failed
(final Object obj)
| 1216 | * @throws JSONException if serialization failed |
| 1217 | */ |
| 1218 | private ChannelBuffer serializeJSON(final Object obj) { |
| 1219 | if (query.hasQueryStringParam("jsonp")) { |
| 1220 | return ChannelBuffers.wrappedBuffer( |
| 1221 | JSON.serializeToJSONPBytes(query.getQueryStringParam("jsonp"), |
| 1222 | obj)); |
| 1223 | } |
| 1224 | return ChannelBuffers.wrappedBuffer(JSON.serializeToBytes(obj)); |
| 1225 | } |
| 1226 | } |
no test coverage detected