Returns the JSON encoding to the beginning.
340538
public function rewind()
    {
        if ($this->step === 0) {
            return;
        }

        $this->stack = [];
        $this->stackType = [];
        $this->valueStack = [];
        $this->errors = [];
        $this->newLine = false;
        $this->first = true;
        $this->line = 1;
        $this->column = 1;
        $this->step = 0;

        $this->processValue($this->initialValue);
    }
388169
def _encode_json(obj):
    '''
    
    '''
    def _dump_obj(obj):
        if isinstance(obj, dict):
            return obj
        d = dict()
        for k in dir(obj):
            if not k.startswith('_'):
                d[k] = getattr(obj, k)
        return d
    return json.dumps(obj, default=_dump_obj)
850938
def to_json(self, lev=0, indent=None):
        
        if lev:
            return self.to_dict(lev + 1)
        else:
            return json.dumps(self.to_dict(1), indent=indent)
433432
def read_json(self):
        
        line = self.stdin.readline()
        if line == '':
            raise EOFError()
        return json.loads(line)
127638
def ToJson(self):
        
        obj = {
            'usage': self.Usage,
            'data': '' if not self.Data else self.Data.hex()
        }
        return obj
502222
public String toJson()
      throws IOException {
    StringWriter writer = new StringWriter();
    try (JsonGenerator generator = jsonFactory.createJsonGenerator(writer)
        .setCodec(objectMapper)) {
      toJsonUtf8(generator);
    }

    return writer.toString();
  }
1033219
public JSONObject toJSON() {
        JSONObject ret = super.toJSON();
        if (arguments != null && arguments.size() > 0) {
            ret.put("arguments", arguments);
        }
        ret.put("operation", operation);
        return ret;
    }
722212
def encode_json(self, serializable):
        
        return json.dumps(serializable.serialize(), cls=self.encoder)
698919
public JSONObject toJSON() {
        JSONObject ret = new JSONObject();
        ret.put("url", url);
        if (env != null) {
            ret.put("env", env);
        }
        return ret;
    }
242534
public String toJson() {
        build();
        try {
            return JsonSerializer.toString(this);
        } catch (IOException e) {
            throw new IndexException(e, "Unformateable JSON search: {}", e.getMessage());
        }
    }
983101
def to_json(self, indent=2):
        
        return json.dumps(self, default=json_encode_for_printing, indent=indent)
565723
public JSONValue toJson() {

        JSONObject result = new JSONObject();
        if (null != getStart()) {
            result.put(JsonKey.START, dateToJson(getStart()));
        }
        if (null != getEnd()) {
            result.put(JsonKey.END, dateToJson(getEnd()));
        }
        if (isWholeDay()) {
            result.put(JsonKey.WHOLE_DAY, JSONBoolean.getInstance(true));
        }
        JSONObject pattern = patternToJson();
        result.put(JsonKey.PATTERN, pattern);
        SortedSet<Date> exceptions = getExceptions();
        if (exceptions.size() > 0) {
            result.put(JsonKey.EXCEPTIONS, datesToJsonArray(exceptions));
        }
        switch (getEndType()) {
            case DATE:
                result.put(JsonKey.SERIES_ENDDATE, dateToJson(getSeriesEndDate()));
                break;
            case TIMES:
                result.put(JsonKey.SERIES_OCCURRENCES, new JSONString(String.valueOf(getOccurrences())));
                break;
            case SINGLE:
            default:
                break;
        }
        if (!isCurrentTillEnd()) {
            result.put(JsonKey.CURRENT_TILL_END, JSONBoolean.getInstance(false));
        }
        if (getParentSeriesId() != null) {
            result.put(JsonKey.PARENT_SERIES, new JSONString(getParentSeriesId().getStringValue()));
        }
        return result;
    }
1005266
public String toJSON() {
		StringBuilder buffer = new StringBuilder();
		buffer.append("{\n");
		buffer.append("\tfile: \'").append(file.getAbsolutePath()).append("',\n");
		buffer.append("\tformat: \'").append(format).append("',\n");
		buffer.append("\taddressing: \'").append(addressing).append("',\n");
		buffer.append("\tendianness: \'").append(endianness).append("',\n");
		buffer.append("\toperatingSystem: \'").append(operatingSystem).append("',\n");
		buffer.append("\ttype: \'").append(type).append("',\n");
		buffer.append("\tinstructionSet: \'").append(instructionSet).append("'\n");
		buffer.append("}");
		return buffer.toString();
	}
104062
public String toJsonString() {
	JSONArray jsonArray = new JSONArray();
	jsonArray.put(data);
	return jsonArray.toString();
    }
307561
private JsonEncoding getJsonEncoding(MediaType contentType) {
		if (contentType != null && contentType.getCharset() != null) {
			Charset charset = contentType.getCharset();
			for (JsonEncoding encoding : JsonEncoding.values()) {
				if (charset.name().equals(encoding.getJavaName())) {
					return encoding;
				}
			}
		}
		return JsonEncoding.UTF8;
	}
288
public String asJSON() {
    Gson gson = new Gson();

    clearExpired();

    Cache jsonCache = new Cache();
    for (ExpiringService svc : cache.values()) {
      jsonCache.cache.add(svc.getService());
    }

    String json = gson.toJson(jsonCache);

    return json;
  }
26893
public JSONObject toJson() {

        try {
            JSONObject result = new JSONObject();
            if (null != getStart()) {
                result.put(JsonKey.START, dateToJson(getStart()));
            }
            if (null != getEnd()) {
                result.put(JsonKey.END, dateToJson(getEnd()));
            }
            if (isWholeDay()) {
                result.put(JsonKey.WHOLE_DAY, true);
            }
            JSONObject pattern = patternToJson();
            result.put(JsonKey.PATTERN, pattern);
            SortedSet<Date> exceptions = getExceptions();
            if (!exceptions.isEmpty()) {
                result.put(JsonKey.EXCEPTIONS, datesToJson(exceptions));
            }
            switch (getEndType()) {
                case DATE:
                    result.put(JsonKey.SERIES_ENDDATE, dateToJson(getSeriesEndDate()));
                    break;
                case TIMES:
                    result.put(JsonKey.SERIES_OCCURRENCES, String.valueOf(getOccurrences()));
                    break;
                case SINGLE:
                default:
                    break;
            }
            if (!isCurrentTillEnd()) {
                result.put(JsonKey.CURRENT_TILL_END, false);
            }
            if (null != getParentSeriesId()) {
                result.put(JsonKey.PARENT_SERIES, getParentSeriesId().getStringValue());
            }
            return result;
        } catch (JSONException e) {
            LOG.error("Could not convert Serial date value to JSON.", e);
            return null;
        }
    }