Json to object.

@param      <T> the generic type
@param json the json
@param clas the clas
@return the object
171236
public static <T> Object jsonToObject(String json, Class<T> clas) {
		ObjectMapper mapper = new ObjectMapper();
		try {
			return mapper.readValue(json, clas);
		} catch (IOException e) {
			JK.throww(e);
			return null;
		}
	}
842768
protected Object jsonDeserialize(byte[] in, Class<?> cls) {
        if (in == null || in.length == 0) {
            return null;
        }
        Object res = null;
        try {
            res = JsonUtils.json2Object(new String(in, "utf-8"), cls);
        } catch (UnsupportedEncodingException e) {
            logger.error("DeSerialize object fail ", e);
        }
        return res;
    }
482096
public static <T> T fromJson(String json, Class<T> klass)
    {
        return GSON.fromJson(json, klass);
    }
1373564
public List<T> getList(String json) throws IOException, JsonFormatException {
		JsonPullParser parser = JsonPullParser.newParser(json);
		return getList(parser, null);
	}
733647
public static JWEObject deserialize(String json) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(json, JWEObject.class);
    }
449006
public static Object fromJson(String json) {
    try {
      JSONObject jsonObject = new JSONObject(json);
      if (jsonObject.has("JSON")) {
        return convert(jsonObject.get("JSON"));
      } else {
        return convert(jsonObject);
      }
    } catch (Exception e) {
      throw new RuntimeException("json=" + json, e);
    }
  }
571063
private <T> T convertObject(byte[] json, Class<T> claz) throws IOException {
        TypeReference<RestSuccessResult<Map<?, ?>>> typeReference = new TypeReference<RestSuccessResult<Map<?, ?>>>() {
        };
        RestSuccessResult<T> successResponse = MAPPER.readValue(json, typeReference);
        Map<?, ?> data = (Map<?, ?>) successResponse.getData();
        return MAPPER.convertValue(data, claz);
    }
346887
public static <T extends BaseBo> T fromJson(String json, Class<T> clazz) {
        return fromJson(json, clazz, null);
    }
573425
public static <T> T fromJson(JsonNode json, Class<T> clazz, ClassLoader classLoader) {
        return SerializationUtils.fromJson(json, clazz, classLoader);
    }
1163148
public static SearchBuilder fromJson(String json) {
        try {
            return JsonSerializer.fromString(json, SearchBuilder.class);
        } catch (IOException e) {
            return SearchBuilderLegacy.fromJson(json);
        }
    }
1017948
@SuppressWarnings("unchecked")
    public static Map<String, Object> toMap(String json) {
        return (Map<String, Object>) JSON.parse(json);
    }
56117
Object asJSON() {
        final Map<String, Object> json = new HashMap<>();
        json.put("JOIN", type.getTag());
        json.putAll(dataSource.asJSON());
        return json;
    }
468148
public static Workflow fromJson(String json) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(json, Workflow.class);
    }
130493
public static org.tensorflow.framework.ConfigProto fromJson(String json) {
        org.tensorflow.framework.ConfigProto.Builder builder = org.tensorflow.framework.ConfigProto.newBuilder();
        try {
            JsonFormat.parser().merge(json,builder);
            org.tensorflow.framework.ConfigProto build = builder.build();
            ByteString serialized = build.toByteString();
            byte[] binaryString = serialized.toByteArray();
            org.tensorflow.framework.ConfigProto configProto = org.tensorflow.framework.ConfigProto.parseFrom(binaryString);
            return configProto;
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }
268969
@JsonValue
	public Object toJsonValue() {
		if (definition != null)
			return definition;
		if (reference != null)
			return reference;
		if (_null != null)
			return _null;
		return null;
	}
1085620
public static String formatJson(String json) {
    assertInitialization();
    return XLog.sLogConfiguration.jsonFormatter.format(json);
  }
641165
public static Props fromJSONString(final String json) throws IOException {
    final Map<String, String> obj = (Map<String, String>) JSONUtils.parseJSONFromString(json);
    final Props props = new Props(null, obj);
    return props;
  }