private ChannelBuffer serializeJSON ( final Object obj ) { if ( query . hasQueryStringParam ( "jsonp" ) ) { return ChannelBuffers . wrappedBuffer ( JSON . serializeToJSONPBytes ( query . getQueryStringParam ( "jsonp" ) , obj ) ) ; } return ChannelBuffers . wrappedBuffer ( JSON . serializeToBytes ( obj ) ) ; }
Helper object for the format calls to wrap the JSON response in a JSONP function if requested . Used for code dedupe .