Method to get the Json string for CDCQuery object

@param cdcQuery
the CDCQuery entity describing need for query
@return the json string
@throws SerializationException
throws SerializationException
976001
private String getCDCQueryJson(CDCQuery cdcQuery) throws SerializationException {
		ObjectMapper mapper = getObjectMapper();
		String json = null;
		try {
			json = mapper.writeValueAsString(cdcQuery);
		} catch (Exception e) {
			throw new SerializationException(e);
		}

		return json;
	}
285800
public JsonNode toJsonObject() {
		ObjectNode node = new ObjectMapper().createObjectNode();
		if (id != null) {
			node.put("id", id);
		}
		for (DataColumn column : columns) {
			String value = content.get(column);
			if (value != null) {
				node.put(column.getCode(), value);
			} else {
				node.put(column.getCode(), "");
			}
		}
		return node;
	}
919041
function serializeQuery(paramsObj) {
    var k, params = [];
    for (k in paramsObj) {
      if (paramsObj.hasOwnProperty(k) && paramsObj[k] !== undefined) {
        params.push(encodeURIComponent(k) + "=" + encodeURIComponent(paramsObj[k]));
      }
    }
    return params.join("&");
  }
1159289
private JsonArray getRecordsForQuery(SalesforceConnector connector, String query) {
    try {
      String soqlQuery = SalesforceExtractor.getSoqlUrl(query);
      List<Command> commands = RestApiConnector.constructGetCommand(connector.getFullUri(soqlQuery));
      CommandOutput<?, ?> response = connector.getResponse(commands);

      String output;
      Iterator<String> itr = (Iterator<String>) response.getResults().values().iterator();
      if (itr.hasNext()) {
        output = itr.next();
      } else {
        throw new DataRecordException("Failed to get data from salesforce; REST response has no output");
      }

      return GSON.fromJson(output, JsonObject.class).getAsJsonArray("records");
    } catch (RestApiClientException | RestApiProcessingException | DataRecordException e) {
      throw new RuntimeException("Fail to get data from salesforce", e);
    }
  }
1258981
function jsonSerialize(): \stdClass {
    return (object) [
      'name' => $this->getName(),
      'url' => ($url = $this->getUrl()) ? (string) $url : null
    ];
  }
20081
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));
  }
256899
public String toJSON(RecordedQuery query) {
		StringWriter sw = new StringWriter();
		JsonGenerator generator;
		if (this.prettyFormat != Format.NONE) {
			JsonGeneratorFactory gf = JSONWriter.getPrettyGeneratorFactory();
			generator = gf.createGenerator(sw);
		} else
			generator = Json.createGenerator(sw);
		
		generator.writeStartObject();
		writeQuery(query, generator);
		generator.writeEnd();

		generator.flush();
		return sw.toString();
	}
186569
public static String serialize(QueryCriterion queryCriterion){
        if(queryCriterion instanceof EqualQueryCriterion){
            EqualQueryCriterion criterion = (EqualQueryCriterion) queryCriterion;
            return criterion.getMetadataKey() + " equals " + escapeString(criterion.getCriterion());
        } else if(queryCriterion instanceof NotEqualQueryCriterion){
            NotEqualQueryCriterion criterion = (NotEqualQueryCriterion) queryCriterion;
            return criterion.getMetadataKey() + " not equals " + escapeString(criterion.getCriterion());
        } else if(queryCriterion instanceof ContainQueryCriterion){
            ContainQueryCriterion criterion = (ContainQueryCriterion) queryCriterion;
            return criterion.getMetadataKey();
        } else if(queryCriterion instanceof NotContainQueryCriterion){
            NotContainQueryCriterion criterion = (NotContainQueryCriterion) queryCriterion;
            return "not " + criterion.getMetadataKey();
        } else if(queryCriterion instanceof InQueryCriterion){
            InQueryCriterion criterion = (InQueryCriterion) queryCriterion;
            StringBuilder sb = new StringBuilder(criterion.getMetadataKey());
            sb.append(" in [ ");
            for(String s : criterion.getCriterion()){
                sb.append(escapeString(s)).append(", ");
            }
            sb.append("]");
            return sb.toString();
        } else if(queryCriterion instanceof NotInQueryCriterion){
            NotInQueryCriterion criterion = (NotInQueryCriterion) queryCriterion;
            StringBuilder sb = new StringBuilder(criterion.getMetadataKey());
            sb.append(" not in [ ");
            for(String s : criterion.getCriterion()){
                sb.append(escapeString(s)).append(", ");
            }
            sb.append("]");
            return sb.toString();
        } else if(queryCriterion instanceof PatternQueryCriterion){
            PatternQueryCriterion criterion = (PatternQueryCriterion) queryCriterion;
            return criterion.getMetadataKey() + " matches " + escapeString(criterion.getCriterion());
        }
        return "";
    }
38878
public static String stringify(final JsonNode json) {
        try {
            return json != null ? createObjectMapper().writeValueAsString(json) : "{}";
        } catch (JsonProcessingException jpx) {
            throw new RuntimeException("A problem occurred while stringifying a JsonNode: " + jpx.getMessage(), jpx);
        }
    }
1080278
public static String jsonToString(JsonNode node) {
        try {
            return node == null ? null : MAPPER.writeValueAsString(node);
        } catch (JsonProcessingException e) {
            throw new SdkClientException("Could not serialize JSON", e);
        }
    }
141302
public JsonNode getDataAttr(String dPath) {
        Lock lock = lockForRead();
        try {
            return DPathUtils.getValue(dataJson, dPath);
        } finally {
            lock.unlock();
        }
    }
956125
public String toMinimizedJsonString() {
        try {
            final Map<String, Object> json = new LinkedHashMap<>();
            json.put("alert", this.message.getAlert());
            if (this.getMessage().getBadge()>0) {
                json.put("badge", Integer.toString(this.getMessage().getBadge()));
            }
            json.put("config", this.config);

            // we strip down the criteria too, as alias/category can be quite long, based on use-case
            final Map<String, Object> shrinkedCriteriaJSON = new LinkedHashMap<>();
            shrinkedCriteriaJSON.put("variants", this.criteria.getVariants());
            shrinkedCriteriaJSON.put("deviceType", this.criteria.getDeviceTypes());
            json.put("criteria", shrinkedCriteriaJSON);

            return OBJECT_MAPPER.writeValueAsString(json);
        } catch (JsonProcessingException e) {
            return "[\"invalid json\"]";
        } catch (IOException e) {
            return "[\"invalid json\"]";
        }
    }
929492
function getQueryString(data) {
    if (!data || typeof data !== 'object' || !Object.keys(data).length)
        return '';
    return '?' + Object.keys(data).map((k) => {
        const value = (typeof data[k] === 'object')
            ? JSON.stringify(data[k])
            : encodeURIComponent(data[k]);
        return `${encodeURIComponent(k)}=${value}`;
    }).join('&');
}
744184
public String getSearchJsonModel() throws IOException {
        DbSearch search = new DbSearch();
        search.setArtifacts(new ArrayList<>());
        search.setModules(new ArrayList<>());
        return JsonUtils.serialize(search);
    }
441322
private static JsonNode toJson(AggregatedHttpMessage res, @Nullable JsonNodeType expectedNodeType) {
        final String content = toString(res);
        final JsonNode node;
        try {
            node = Jackson.readTree(content);
        } catch (JsonParseException e) {
            throw new CentralDogmaException("failed to parse the response JSON", e);
        }

        if (expectedNodeType != null && node.getNodeType() != expectedNodeType) {
            throw new CentralDogmaException(
                    "invalid server response; expected: " + expectedNodeType +
                    ", actual: " + node.getNodeType() + ", content: " + content);
        }
        return node;
    }
35428
@Override
    public String toJSONString() {
        JSONStringer js = new JSONStringer();
        try {

            js.object();

            // status code (1 byte)
            js.keySymbolValuePair(JSON_STATUS_KEY, getStatusCode());

            // column schema
            js.key(JSON_SCHEMA_KEY).array();
            for (int i = 0; i < getColumnCount(); i++) {
                js.object();
                js.keySymbolValuePair(JSON_NAME_KEY, getColumnName(i));
                js.keySymbolValuePair(JSON_TYPE_KEY, getColumnType(i).getValue());
                js.endObject();
            }
            js.endArray();

            // row data
            js.key(JSON_DATA_KEY).array();
            VoltTableRow row = cloneRow();
            row.resetRowPosition();
            while (row.advanceRow()) {
                js.array();
                for (int i = 0; i < getColumnCount(); i++) {
                    row.putJSONRep(i, js);
                }
                js.endArray();
            }
            js.endArray();

            js.endObject();
        }
        catch (JSONException e) {
            e.printStackTrace();
            throw new RuntimeException("Failed to serialized a table to JSON.", e);
        }
        return js.toString();
    }
1286225
public String toJson() {
        Map<String, Object> data = toMap();
        return SerializationUtils.toJsonString(data);
    }