Set global JSON reader API (Jackson, Gson, Boon, FastJson, etc.).
183158
protected void initJsonReader() {
		String readerList = config.getJsonReaders();
		if (readerList != null) {
			String[] readers = readerList.split(",");
			Set<String> supportedReaders = TreeReaderRegistry.getReadersByFormat("json");
			TreeReader selectedReader = null;
			for (String reader : readers) {
				reader = reader.trim().toLowerCase();
				if (!reader.isEmpty()) {
					for (String supportedReader : supportedReaders) {
						int i = supportedReader.lastIndexOf('.');
						if (i > -1) {
							supportedReader = supportedReader.substring(i + 1);
						}
						if (supportedReader.toLowerCase().contains(reader)) {
							selectedReader = TreeReaderRegistry.getReader(supportedReader);
							logger.info("Default JSON deserializer/reader is \"" + selectedReader.getClass() + "\".");
							TreeReaderRegistry.setReader("json", selectedReader);
							break;
						}
					}
					if (selectedReader != null) {
						break;
					}
				}
			}
		}
	}
142988
public void setFromJSON(Context context, JSONObject properties) {
        String backgroundResStr = optString(properties, Properties.background);
        if (backgroundResStr != null && !backgroundResStr.isEmpty()) {
            final int backgroundResId = getId(context, backgroundResStr, "drawable");
            setBackGround(context.getResources().getDrawable(backgroundResId, null));
        }

        setBackgroundColor(getJSONColor(properties, Properties.background_color, getBackgroundColor()));
        setGravity(optInt(properties, TextContainer.Properties.gravity, getGravity()));
        setRefreshFrequency(optEnum(properties, Properties.refresh_freq, getRefreshFrequency()));
        setTextColor(getJSONColor(properties, Properties.text_color, getTextColor()));
        setText(optString(properties, Properties.text, (String) getText()));
        setTextSize(optFloat(properties, Properties.text_size, getTextSize()));

        final JSONObject typefaceJson = optJSONObject(properties, Properties.typeface);

        if (typefaceJson != null) {
            try {
                Typeface typeface = WidgetLib.getTypefaceManager().getTypeface(typefaceJson);
                setTypeface(typeface);
            } catch (Throwable e) {
                Log.e(TAG, e, "Couldn't set typeface from properties: %s", typefaceJson);
            }
        }
    }
77218
def register_json():
    """"""
    from anyjson import serialize as json_serialize
    from anyjson import deserialize as json_deserialize

    registry.register('json', json_serialize, json_deserialize,
                      content_type='application/json',
                      content_encoding='utf-8')
538461
protected void setJsonValue(JsonObjectBuilder builder, T value) {
    // I don't like this - there should really be a way to construct a disconnected JSONValue...
    if (value instanceof Boolean) {
      builder.add("value", (Boolean) value);
    } else if (value instanceof Double) {
      builder.add("value", (Double) value);
    } else if (value instanceof Integer) {
      builder.add("value", (Integer) value);
    } else if (value instanceof Long) {
      builder.add("value", (Long) value);
    } else if (value instanceof BigInteger) {
      builder.add("value", (BigInteger) value);
    } else if (value instanceof BigDecimal) {
      builder.add("value", (BigDecimal) value);
    } else if (value == null) {
      builder.addNull("value");
    } else {
      builder.add("value", value.toString());
    }
  }
357161
def _load_json(self, filename):
        """"""
        with open(filename, 'r') as file_handle:
            self._sensors.update(json.load(
                file_handle, cls=MySensorsJSONDecoder))
1239101
public void consume(String json) throws JsonParseException, IOException {
		if (ApitraryOrmConfiguration.showJson()) {
			showJson(json);
		}

		JsonFactory f = new JsonFactory();
		JsonParser jp = f.createJsonParser(json);

		JsonToken token = jp.nextToken();
		String fieldName = jp.getCurrentName();
		while (!(token == null && fieldName == null)) {
			on(token, fieldName, jp);

			token = jp.nextToken();
			fieldName = jp.getCurrentName();
		}
	}
511409
def read_json(filepath, intkeys=True, intvalues=True):
    
    d = json.load(ensure_open(find_filepath(filepath), mode='rt'))
    d = update_dict_types(d, update_keys=intkeys, update_values=intvalues)
    return d
790962
@Deprecated
    public void surf(Reader json, SurfingConfiguration configuration) {
        ensureSetting(configuration);
        jsonParserAdapter.parse(json, new SurfingContext(configuration));
    }
163423
function(json) {
			Object.keys(json).forEach(function(key) {
				this.set(key, json[key]);
			}, this);
		}
893583
public void readJson(@Nullable final JsonObject json) {
    if (null == json) return;
    min = json.get("min").getAsDouble();
    max = json.get("max").getAsDouble();
    negatives = json.get("negatives").getAsInt();
    positives = json.get("positives").getAsInt();
    zeros = json.get("zeros").getAsInt();
    sum0 = json.get("sum0").getAsInt();
    sum1 = json.get("sum1").getAsDouble();
    sum2 = json.get("sum2").getAsDouble();
    sumLog = json.get("sumLog").getAsDouble();
  }
161822
public void update(String jsonString, Object object) {
		try {
			mapper.readerForUpdating(object).readValue(jsonString);
		} catch (JsonProcessingException e) {
			logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
		} catch (IOException e) {
			logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
		}
	}
918641
def _read_jsonl(filepath, kwargs):
    """"""
    with open(filepath) as data_file:
        data = [json.loads(line, **kwargs)
                for line in data_file
                if len(line) > 0]
    return data
142598
def dict_jsonify(param):
    """"""
    if not isinstance(param, dict):
        param = dict(param)
    return jsonify(param)
1231161
def set_dial(self, json_value, index, timezone=None):
        

        values = self.json_state
        values["nonce"] = str(random.randint(0, 1000000000))
        if timezone is None:
            json_value["channel_configuration"] = {"channel_id": "10"}
            values["dials"][index] = json_value
            response = self.api_interface.set_device_state(self, values)
        else:
            json_value["channel_configuration"] = {"channel_id": "1", "timezone": timezone}
            values["dials"][index] = json_value
            response = self.api_interface.set_device_state(self, values)
        return response
857556
public static <T> T fromJson(JsonNode json, Class<T> clazz, ClassLoader classLoader) {
        if (json == null) {
            return null;
        }
        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
        if (classLoader != null) {
            Thread.currentThread().setContextClassLoader(classLoader);
        }
        try {
            ObjectMapper mapper = poolMapper.borrowObject();
            if (mapper != null) {
                try {
                    return mapper.readValue(json.toString(), clazz);
                } finally {
                    poolMapper.returnObject(mapper);
                }
            }
            throw new DeserializationException("No ObjectMapper instance avaialble!");
        } catch (Exception e) {
            throw e instanceof DeserializationException ? (DeserializationException) e
                    : new DeserializationException(e);
        } finally {
            Thread.currentThread().setContextClassLoader(oldClassLoader);
        }
    }
105019
public static final AuthToken fromJSON(String json) {
        try {
            return mapper.reader(AuthToken.class).readValue(json);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
285897
private function LoadGlobalVariablesFromJson()
    {
        $variables_def = Json::Decode(file_get_contents(
            $this->definitions_path . "variables.json")
        );

        foreach($variables_def as $header => $namespaces)
        {
            $this->symbols->AddHeader($header);
            
            foreach($namespaces as $namespace => $variables)
            {
                foreach($variables as $variable_name => $variable_data)
                {
                    if(!isset($variable_data["description"]))
                        $variable_data["description"] = "";
                    
                    $variable = new Element\GlobalVariable(
                        $variable_name,
                        $variable_data["type"],
                        $variable_data["description"]
                    );

                    $this->symbols->headers[$header]->AddGlobalVariable(
                        $variable,
                        $namespace
                    );
                }
            }
        }

        unset($variables_def);
    }