Don't use this directly. Used for debugging only.

@return the base JSONArray
550094
public static JSONArray getBaseArray() {
		ensureLoaded();
		JSONArray baseArray = new JSONArray();
		for (VersionHistoryEntry entry : versionHistoryEntries) {
			baseArray.put(entry);
		}
		return baseArray;
	}
1069013
public JSONObject toJson() throws IOException {
    String base64 = new Zip().zip(getDirectory());
    Map<String, String> map = ImmutableMap.of(
      "className", this.getClass().getName(),
      BASE64_JSON_KEY, base64);
    
    return new JSONObject(map);
  }
1146096
public @Nonnull Iterable<JsonArray> arrays() {
        final JsonArray parent=this;
        return () -> {
            final Iterator<JsonElement> iterator = parent.iterator();
            return new Iterator<JsonArray>() {

                @Override
                public boolean hasNext() {
                    return iterator.hasNext();
                }

                @Override
                public JsonArray next() {
                    return iterator.next().asArray();
                }

                @Override
                public void remove() {
                    iterator.remove();
                }
            };
        };
    }
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;
    }
102039
@NonNull
  public String toJson() {
    Gson gson = new GsonBuilder()
      .registerTypeAdapterFactory(GeometryAdapterFactory.create())
      .registerTypeAdapter(BoundingBox.class, new BoundingBoxTypeAdapter())
      .registerTypeAdapterFactory(GeocodingAdapterFactory.create())
      .create();
    return gson.toJson(this, GeocodingResponse.class);
  }
267340
protected JsonObject argumentsToJson() {
    JsonObject result = new JsonObject();
    for (Argument a : _arguments) {
      if (a.specified())
        result.addProperty(a._name,a.originalValue());
    }
    return result;
  }
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;
        }
    }
883856
public JsonArray names() throws JsonException {
        return nameValuePairs.isEmpty()
                ? null
                : new JsonArray(new ArrayList<String>(nameValuePairs.keySet()));
    }
1264606
Object asJSON() {
        final List<Object> json = new ArrayList<>();
        for (Join join : joins) { json.add(join.asJSON()); }
        return json;
    }
1143664
public function jsonSerialize()
		{
			// base values
			$values = (object)
			[
				'name'      => $this->name,
				'type'      => $this->type,
				'value'     => $this->value,
				'text'      => $this->text,
				'field'     => null,
				'attrs'     => (object) [],
			];

			// override if field set
			if (isset($this->field))
			{
				$values->field = $this->field->type;
				$values->attrs = (object) $this->field->attrs;

			}
			return $values;
		}
675586
public JsonArray toJson() {
        Map<String, Integer> portMap = getContainerPortToHostPortMap();
        if (portMap.isEmpty()) {
            return null;
        }

        JsonArray ret = new JsonArray();
        Map<String, String> bindToMap = getBindToHostMap();

        for (Map.Entry<String, Integer> entry : portMap.entrySet()) {
            JsonObject mapping = new JsonObject();
            String containerPortSpec = entry.getKey();
            Matcher matcher = PROTOCOL_SPLIT_PATTERN.matcher(entry.getKey());
            if (!matcher.matches()) {
                throw new IllegalStateException("Internal error: " + entry.getKey() +
                                                " doesn't contain protocol part and doesn't match "
                                                + PROTOCOL_SPLIT_PATTERN);
            }

            mapping.addProperty("containerPort", Integer.parseInt(matcher.group(1)));
            if (matcher.group(2) != null) {
                mapping.addProperty("protocol", matcher.group(2));
            }

            Integer hostPort = entry.getValue();
            if (hostPort != null) {
                mapping.addProperty("hostPort", hostPort);
            }

            if (bindToMap.containsKey(containerPortSpec)) {
                mapping.addProperty("hostIP", bindToMap.get(containerPortSpec));
            }

            ret.add(mapping);
        }

        return ret;
    }
104062
public String toJsonString() {
	JSONArray jsonArray = new JSONArray();
	jsonArray.put(data);
	return jsonArray.toString();
    }
786704
public final PJsonArray toJSON() {
        JSONArray jsonArray = new JSONArray();
        final int size = this.array.size();
        for (int i = 0; i < size; i++) {
            final Object o = get(i);
            if (o instanceof PYamlObject) {
                PYamlObject pYamlObject = (PYamlObject) o;
                jsonArray.put(pYamlObject.toJSON().getInternalObj());
            } else if (o instanceof PYamlArray) {
                PYamlArray pYamlArray = (PYamlArray) o;
                jsonArray.put(pYamlArray.toJSON().getInternalArray());
            } else {
                jsonArray.put(o);
            }

        }
        return new PJsonArray(null, jsonArray, getContextName());
    }
694544
public String toJsonString() {
    	JSONArray jsonArray = new JSONArray();        
        for (LabeledItem<T> labeledItem : data) {
            JSONArray itemArray = new JSONArray();
            itemArray.put(labeledItem.getLabel());
            itemArray.put(labeledItem.getValue());
            jsonArray.put(itemArray);
        }
        JSONArray outerArray = new JSONArray();
        outerArray.put(jsonArray);
        return outerArray.toString();
    }
984970
public JSONObject toJson() {
        JSONObject obj = new JSONObject().put(OBJECT_LOCATION, new JSONObject().put("lat", lat).put("lng", lng))
                .put(STRING_NAME, name).put(STRING_TYPES, new JSONArray(types));
        if (accuracy != -1)
            obj.put(INTEGER_ACCURACY, accuracy);
        if (phoneNumber != null)
            obj.put(STRING_PHONE_NUMBER, phoneNumber);
        if (address != null)
            obj.put(STRING_ADDRESS, address);
        if (website != null)
            obj.put(STRING_WEBSITE, website);
        if (locale != null)
            obj.put(STRING_LANGUAGE, locale.getLanguage());
        return obj;
    }
589219
public JSONObject toJson() {
        JSONObject json = new JSONObject();

        Field[] fields = clazz.getDeclaredFields();

        try {
            for (Field field : fields) {

                if (!field.isAnnotationPresent(ModelField.class)) {
                    continue;
                }

                String name = field.getName();
                boolean was = field.isAccessible();

                field.setAccessible(true);

                switch (toFieldEnum(field)) {
                    case INT:
                        json.put(name, field.getInt(this));
                        break;
                    case LONG:
                        json.put(name, field.getLong(this));
                        break;
                    case FLOAT:
                        json.put(name, field.getFloat(this));
                        break;
                    case DOUBLE:
                        json.put(name, field.getDouble(this));
                        break;
                    case STRING:
                        json.put(name, field.get(this));
                        break;
                    case BOOLEAN:
                        json.put(name, field.getBoolean(this));
                        break;
                    case LIST:
                        JSONArray list = new JSONArray();
                        List<String> stringList = (List<String>) field.get(this);

                        if (stringList != null) {
                            for (String value : stringList) {
                                list.put(value);
                            }
                        }

                        json.put(name, list);
                        break;
                }

                field.setAccessible(was);
            }
        } catch (IllegalAccessException | JSONException e) {
            e.printStackTrace();
        }

        return json;
    }
833852
@Override
    Object asJSON() {
        final List<Object> json = new ArrayList<>();
        if (fromAlias != null) { json.add("." + fromAlias + "." + keyPath); }
        else { json.add("." + keyPath); }
        return json;
    }