Read config objects stored in JSON format from <code>String</code>

@param content of config
@return config
@throws IOException error
344920
public static Map<String, ? extends CacheConfig> fromJSON(String content) throws IOException {
        return new CacheConfigSupport().fromJSON(content);
    }
164778
@SuppressWarnings({"unchecked"})
    public <T> T read(File jsonFile, Configuration configuration) throws IOException {
        notNull(jsonFile, "json file can not be null");
        isTrue(jsonFile.exists(), "json file does not exist");
        notNull(configuration, "jsonProvider can not be null");

        FileInputStream fis = null;
        try {
            fis = new FileInputStream(jsonFile);
            return read(fis, configuration);
        } finally {
            Utils.closeQuietly(fis);
        }
    }
1344786
@Deprecated
    public static DocumentContext parse(URL json, Configuration configuration) throws IOException {
        return new ParseContextImpl(configuration).parse(json);
    }
783706
public Serializable parseConfig (File source)
        throws IOException, SAXException
    {
        Digester digester = new Digester();
        Serializable config = createConfigObject();
        addRules(digester);
        digester.push(config);
        digester.parse(new FileInputStream(source));
        return config;
    }
303625
public static Environment parse(String content) throws IOException {
		try {
			return new ConfigUtil.LowerCaseYamlMapper().readValue(content, Environment.class);
		} catch (JsonMappingException e) {
			throw new SqlClientException("Could not parse environment file. Cause: " + e.getMessage());
		}
	}
459701
public T parse(String jsonString) throws IOException {
        JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(jsonString);
        jsonParser.nextToken();
        return parse(jsonParser);
    }
195735
public JSONObject getJsonConfig(Path name)
      throws IOException, JSONException {
    String pathString = name.toUri().getPath();
    String xml = new Path(pathString).getName();
    File jsonFile = new File(pathString.replace(xml, MATERIALIZEDJSON))
        .getAbsoluteFile();
    if (jsonFile.exists()) {
      InputStream in = new BufferedInputStream(new FileInputStream(jsonFile));
      if (in != null) {
        JSONObject json = instantiateJsonObject(in);
        // Try to load the xml entity inside the json blob.
        if (json.has(xmlToThrift(xml))) {
          return json.getJSONObject(xmlToThrift(xml));
        }
      }
    }
    return null;
  }
1262438
def read_string(self, content):
        

        header_file = utils.create_temp_file_name(suffix='.h')
        with open(header_file, "w+") as f:
            f.write(content)

        try:
            decls = self.read_file(header_file)
        except Exception:
            utils.remove_file_no_raise(header_file, self.__config)
            raise
        utils.remove_file_no_raise(header_file, self.__config)

        return decls
185591
public static Properties loadFromString(String content) {
		Properties p = new Properties();
		try (Reader reader = new StringReader(content)) {
			p.load(reader);
		} catch (IOException ignored) { // NOSONAR
		}
		return p;
	}
547882
@SuppressWarnings({"unchecked"})
    public <T> T read(File jsonFile) throws IOException {
        return read(jsonFile, Configuration.defaultConfiguration());
    }
514807
public Map<String, Object> fromJson(String json) throws IOException {
    if (json == null) {
      throw new IllegalArgumentException("json == null");
    }
    if (json.length() == 0) {
      throw new IllegalArgumentException("json empty");
    }
    return fromJson(new StringReader(json));
  }
18450
@JsonIgnore
    public void encodeAndSetContent(String content) {
        encodeAndSetContent(content != null ? content.getBytes() : null);
    }
263321
@SuppressWarnings("unchecked")
    @Override
    public T readConfig(String filePath) throws ConfigurationException {
        XStream xstream = new XStream(new StaxDriver());
        xstream.alias("configuration", clazz);
        return (T) xstream.fromXML(new File(filePath));
    }
1132321
public JSONArray element( String value, JsonConfig jsonConfig ) {
      if( value == null ) {
         this.elements.add("");
      } else if( JSONUtils.hasQuotes( value )) {
         this.elements.add(value);
      } else if( JSONNull.getInstance().equals( value )) {
         this.elements.add( JSONNull.getInstance() );
      } else if( JSONUtils.isJsonKeyword(value,jsonConfig)) {
         if( jsonConfig.isJavascriptCompliant() && "undefined".equals( value )){
            this.elements.add( JSONNull.getInstance() );
         }else{
            this.elements.add(value);
         }
      } else if( JSONUtils.mayBeJSON( value ) ){
         try{
            this.elements.add( JSONSerializer.toJSON( value, jsonConfig ) );
         }catch( JSONException jsone ){
            this.elements.add( value );
         }
      } else {
         this.elements.add(value);
      }
      return this;
   }
197808
protected function readConfig()
    {
        $data = FileHelper::getFileContent($this->configFile);
        
        if ($data) {
            return Json::decode($data);
        }
        
        return false;
    }
536566
public static WorkflowRule fromJson(String json) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(json, WorkflowRule.class);
    }
1343878
public static Map<String, Object> parseJsonString(String json) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {
        };
        return mapper.readValue(json, typeRef);
    }