Returns a JSON representation of this filter to send to the server. Used
by the SDK internally.

@return a JSON representation of this filter
482938
public ObjectNode toJson() {
		ObjectMapper mapper = new ObjectMapper();
		ObjectNode node = mapper.createObjectNode();
		ObjectNode attributeNode = mapper.createObjectNode();

		node.put(attribute.getCode(), attributeNode);
		attributeNode.put("op", operation.getOp());

		return node;
	}
99339
public String toJson() {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapterFactory(DirectionsAdapterFactory.create());
    gson.registerTypeAdapter(Point.class, new PointAsCoordinatesTypeAdapter());
    return gson.create().toJson(this);
  }
493413
def to_JSON(self):
        
        return json.dumps({"reception_time": self._reception_time,
                           "Location": json.loads(self._location.to_JSON()),
                           "Weather": json.loads(self._weather.to_JSON())
                           })
321742
def get_json(self):
        
        port = self.get_basic_json()
        port['Functions'] = {
            'Function': [f.get_json() for f in self.functions.values()]
        }
        return port
502222
public String toJson()
      throws IOException {
    StringWriter writer = new StringWriter();
    try (JsonGenerator generator = jsonFactory.createJsonGenerator(writer)
        .setCodec(objectMapper)) {
      toJsonUtf8(generator);
    }

    return writer.toString();
  }
218921
def json(self):
        
        return {
            "status": self.status,
            "criteria_name": self.criteria_name,
            "warnings": [w.json() for w in self.warnings],
            "settings": self.settings,
        }
981361
public function toJson()
    {
        array_walk_recursive($this->params, function (&$value) {
            $value = (string) $value;
        });
        return json_encode($this->params);
    }
212430
public JSONObject toJSON() {
        try {
            return new JSONObject(properties).putOpt("name", getName());
        } catch (JSONException e) {
            e.printStackTrace();
            Log.e(TAG, e, "toJSON()");
            throw new RuntimeAssertion("NodeEntry.toJSON() failed for '%s'", this);
        }
    }
226646
def _to_json(self):
        
        return dict(( (k, v) for k, v in self.__dict__.iteritems() if k != 'server'))
58411
JSONObject toJson() {
        JSONObject ret = new JSONObject();
        ret.put("type",type.name());
        if (targetConfig != null) {
            ret.put("target",targetConfig.toJson());
        }
        return ret;
    }
698919
public JSONObject toJSON() {
        JSONObject ret = new JSONObject();
        ret.put("url", url);
        if (env != null) {
            ret.put("env", env);
        }
        return ret;
    }
16410
public JSONObject getJson() throws JSONException {
        JSONObject json = create();
        json.put("processInstance", processInstance.getJson());
        if (!children.isEmpty()) {
            JSONArray childrenArr = new JSONArray();
            for (LinkedProcessInstance child : children) {
                childrenArr.put(child.getJson());
            }
            json.put("children", childrenArr);
        }
        return json;
    }
135577
@Override
    public String toJSON() {
        final ObjectMapper mapper = buildObjectMapperForSerialization();
        try {
            return mapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            throw new IllegalStateException("Object cannot be parsed as JSON.", e);
        }
    }
45685
public String toJSON()
	{
		StringBuffer sb = new StringBuffer();
		sb.append("{\n");
		
		// generate head
		sb.append("\t\"head\": {\n");
		if(!bindings.isEmpty()) {
			sb.append("\t\t\"vars\": [\n");
			QueryBinding top = bindings.get(0);
			boolean first = true;
			for(QueryArgument arg : top.getBoundArgs()) {
				if(arg.isVar()) {
					if(first) {
						first = false;
					}
					else {
						sb.append(",\n");
					}
					sb.append("\t\t\t\"");
					sb.append(arg.getValueAsString());
					sb.append("\"");
				}
			}
			sb.append("\n\t\t]\n");
		}
		sb.append("\t},\n");
		
		if(query.isAsk()) {
			if(ask) {
				sb.append("\t\"boolean\": true\n");
			}
			else {
				sb.append("\t\"boolean\": false\n");
			}
		}
		else {
			// otherwise generate results
			sb.append("\t\"results\": {\n");
			sb.append("\t\t\"bindings\": [\n");
			boolean firstBinding = true;
			for(QueryBinding binding : bindings) {
				if(firstBinding) {
					firstBinding = false;
				}
				else {
					sb.append(",\n");
				}
				sb.append("\t\t\t{\n");
				boolean firstVar = true;
				for(QueryArgument key : binding.getBoundArgs()) {
					if(key.isVar()) {
						if(firstVar) {
							firstVar = false;
						}
						else {
							sb.append(",\n");
						}
						sb.append("\t\t\t\t\"");
						sb.append(key.getValueAsString());
						sb.append("\": {\n");
						QueryArgument value = binding.get(key);
						switch(value.getType()) {
						case URI:
							sb.append("\t\t\t\t\t\"type\": \"uri\",\n");
							sb.append("\t\t\t\t\t\"value\": \"");
							sb.append(value.getValueAsIRI().toString().replaceAll("\"", "\\\\\""));
							sb.append("\"\n");
							break;
						case LITERAL:
							sb.append("\t\t\t\t\t\"type\": \"literal\",\n");
							sb.append("\t\t\t\t\t\"value\": \"");
							sb.append(value.getValueAsLiteral().getLiteral().replaceAll("\"", "\\\\\""));
							sb.append("\"\n");
							break;
						case BNODE:
							sb.append("\t\t\t\t\t\"type\": \"bnode\",\n");
							sb.append("\t\t\t\t\t\"value\": \"");
							sb.append(value.getValueAsBNode().getID().toString().replaceAll("\"", "\\\\\""));
							sb.append("\"\n");
							break;
						default:
						}
						sb.append("\t\t\t\t}");
					}
				}
				sb.append("\n\t\t\t}");
			}
			sb.append("\n\t\t]\n\t}\n");
		}
		sb.append("}\n");
		
		return sb.toString();
	}
986853
public String toJSON() {

        StringBuffer result = new StringBuffer();
        result.append("{\n");
        for (Entry<String, List<String>> simpleEntry : m_simpleAttributes.entrySet()) {
            result.append("\"").append(simpleEntry.getKey()).append("\"").append(": [\n");
            boolean firstValue = true;
            for (String value : simpleEntry.getValue()) {
                if (firstValue) {
                    firstValue = false;
                } else {
                    result.append(",\n");
                }
                result.append("\"").append(value).append("\"");
            }
            result.append("],\n");
        }
        for (Entry<String, List<CmsEntity>> entityEntry : m_entityAttributes.entrySet()) {
            result.append("\"").append(entityEntry.getKey()).append("\"").append(": [\n");
            boolean firstValue = true;
            for (CmsEntity value : entityEntry.getValue()) {
                if (firstValue) {
                    firstValue = false;
                } else {
                    result.append(",\n");
                }
                result.append(value.toJSON());
            }
            result.append("],\n");
        }
        result.append("\"id\": \"").append(m_id).append("\"");
        result.append("}");
        return result.toString();
    }
1181149
@Override
    public String toJSONString()
    {
        final JSONObject object = toJSONObject();

        if (null != object)
        {
            return object.toString();
        }
        return null;
    }
1096536
public JsonObject toJson() {
        final JsonObjectBuilder builder = Json.createObjectBuilder();
        builder.add(EL_DATA_TYPE, dataType);
        builder.add(EL_DATA_CONTENT_TYPE, dataContentTypeStr);
        if (meta == null) {
            return builder.build();
        }
        builder.add(EL_META_TYPE, metaType);
        builder.add(EL_META_CONTENT_TYPE, metaContentTypeStr);
        if (meta instanceof JsonObject) {
            final JsonObject jo = (JsonObject) meta;
            return builder.add(metaType, jo).build();
        }
        if (meta instanceof ToJsonCapable) {
            final ToJsonCapable tjc = (ToJsonCapable) meta;
            return builder.add(metaType, tjc.toJson()).build();
        }
        if (meta instanceof Base64Data) {
            final Base64Data base64data = (Base64Data) meta;
            return builder.add(metaType, base64data.getEncoded()).build();
        }
        throw new IllegalStateException("Unknown meta object type: " + meta.getClass());
    }